https://bugs.llvm.org/show_bug.cgi?id=46394

            Bug ID: 46394
           Summary: [codeview] Misssing LF_NESTTYPE with nested templates
                    (structure/class)
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: DebugInfo
          Assignee: unassignedb...@nondot.org
          Reporter: international.phan...@gmail.com
                CC: jdevliegh...@apple.com, keith.wal...@arm.com,
                    llvm-bugs@lists.llvm.org,
                    paul_robin...@playstation.sony.com

Given the following test case:

//---------------------------------------------------------

template <typename T> struct Template_A {
  template <typename U> struct Template_B { U Member_TB; };
  Template_B<char> Member_TA;
};

Template_A<int> MyTemplate;

struct Struct_A {
  struct Struct_B {
    char Member_SB;
  };
  Struct_B Member_SA;
};

Struct_A MyClass;

//---------------------------------------------------------

Using the command line to generate debug info CodeView:

clang -c -g -O0 test.cpp -o test-cv.o -gcodeview --target=x86_64-windows

The output generated by llvm-pdbutil, shows that Clang does emit the
LF_NESTTYPE for nested structure/class. But it does not emit it if the
structure/class is a template.

The LF_STRUCTURE in the case of templates, does not have the 'contains nested
class' flag.

----------
`Struct_A`
----------
0x100C | LF_STRUCTURE `Struct_A`
         field list: 0x100B
         options: contains nested class     ** Nested Info **

0x100B | LF_FIELDLIST
         - LF_MEMBER [name = `Member_SA`, Type = 0x100A]
         - LF_NESTTYPE [name = `Struct_B`, parent = 0x100A]

-----------------
`Template_A<int>`
-----------------
0x1003 | LF_STRUCTURE `Template_A<int>`
         field list: 0x1002
         options:                           ** Missing Nested Info **

0x1002 | LF_FIELDLIST
         - LF_MEMBER [name = `Member_TA`, Type = 0x1001]

MSVC emits the LF_NESTTYPE for all cases (templates and non-templates).

----------
`Struct_A`
----------
0x1009 | LF_STRUCTURE `Struct_A`
         field list: 0x1008
         options: contains nested class     ** Nested Info **

0x1008 | LF_FIELDLIST
         - LF_NESTTYPE [name = `Struct_B`, parent = 0x1007]
         - LF_MEMBER [name = `Member_SA`, Type = 0x1007]

-----------------
`Template_A<int>`
-----------------
0x1003 | LF_STRUCTURE `Template_A<int>`
         field list: 0x1002
         options: contains nested class     ** Nested Info **

0x1002 | LF_FIELDLIST
         - LF_NESTTYPE [name = `?$Template_B@D`, parent = 0x1001]
         - LF_MEMBER [name = `Member_TA`, Type = 0x1001]

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to