https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78329

            Bug ID: 78329
           Summary: incorrect debug info for return type deduction C++14
           Product: gcc
           Version: 6.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chihin.ko at oracle dot com
  Target Milestone: ---

cat t.cc
class AA {
public:
    auto func(int arg) {
        int i = 0;
        for (; i < arg; i++);
        return i;
    }
} a;

auto func1(int arg) {
    int i = 0;
    for (; i < arg; i++);
    return i;
}

int main() {
    auto res = a.func(5);
    res = func1(5);
    return 0;
}

The return type of function "func" should resolved to type "int":

< 2><0x00000034>      DW_TAG_subprogram
                        DW_AT_external              yes(1)
                        DW_AT_name                  "func"
                        DW_AT_decl_file             0x00000001
/workspace/chko/ws/dinstall/dbx_test/bugid/2484659
6/g61/t.cc
                        DW_AT_decl_line             0x00000003
                        DW_AT_linkage_name          "_ZN2AA4funcEi"
                        DW_AT_type                  <0x00000054>
                        DW_AT_accessibility         DW_ACCESS_public
                        DW_AT_declaration           yes(1)
                        DW_AT_object_pointer        <0x00000048>
< 3><0x00000048>        DW_TAG_formal_parameter
                          DW_AT_type                  <0x00000059>
                          DW_AT_artificial            yes(1)
< 3><0x0000004d>        DW_TAG_formal_parameter
                          DW_AT_type                  <0x00000064>
< 1><0x00000054>    DW_TAG_unspecified_type
                      DW_AT_name                  "auto"  <== should resolve to
type "int"

Reply via email to