<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/57769>57769</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
void underlying type for LF_ENUM inside class template.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
debuginfo,
platform:windows
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ZequanWu
</td>
</tr>
</table>
<pre>
```
$ cat a.cpp
template <typename T>
class A {
public:
T data;
enum class E { e0, e1 };
};
using AI = A<int>;
AI a;
AI::E e = AI::E::e0;
int main() {
return 0;
}
$ clang-cl /Z7 /c a.cpp /Foa.obj && lld-link /out:a.exe /debug /nodefaultlib /entry:main a.obj
$ llvm-pdbutil dump a.pdb --types
Types (TPI Stream)
============================================================
Showing 6 records
0x1000 | LF_ARGLIST [size = 8]
0x1001 | LF_PROCEDURE [size = 16]
return type = 0x0074 (int), # args = 0, param list = 0x1000
calling conv = cdecl, options = None
0x1002 | LF_CLASS [size = 44] `A<int>`
unique name: `.?AV?$A@H@@`
vtable: <no type>, base list: <no type>, field list: <no type>
options: forward ref (-> 0x1005) | has unique name, sizeof 0
0x1003 | LF_ENUM [size = 44] `A<int>::E`
unique name: `.?AW4E@?$A@H@@`
field list: <no type>, underlying type: 0x0003 (void)
options: forward ref (= 0x1003) | has unique name | is nested
0x1004 | LF_FIELDLIST [size = 32]
- LF_MEMBER [name = `data`, Type = 0x0074 (int), offset = 0, attrs = public]
- LF_NESTTYPE [name = `E`, parent = 0x1003]
0x1005 | LF_CLASS [size = 44] `A<int>`
unique name: `.?AV?$A@H@@`
vtable: <no type>, base list: <no type>, field list: 0x1004
options: contains nested class | has unique name, sizeof 4
```
The LF_ENUM has `void` underlying type and no field list index.
While if I compile with dwarf, it has `int` underlying type and `DW_TAG_enumerator` children.
```
0x0000004c: DW_TAG_enumeration_type
DW_AT_type (0x0000005d "int")
DW_AT_enum_class (true)
DW_AT_name ("E")
DW_AT_byte_size (0x04)
DW_AT_decl_file ("/usr/local/google/home/zequanwu/llvm-project/build/lldb-test/a.cpp")
DW_AT_decl_line (5)
0x00000055: DW_TAG_enumerator
DW_AT_name ("e0")
DW_AT_const_value (0)
0x00000058: DW_TAG_enumerator
DW_AT_name ("e1")
DW_AT_const_value (1)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzdV0tz4jgQ_jXmooIy8gM4cHDAzKYqyU4FZlM7F0q2ZdCssBhbzmN-_XZLNm-S1NZedikHLKlb_fXX3VInUdnb2And5nGnjhs51Ccp04T10u3WTmm-2UqmOXG8iX7b8oJtOFk4XmyXU8mqikTEGdzYiW2dSJE6XmSHhCxIxjRzvJt2ghf1hli9GPUIdx06IbwPg-lO7vC9rkSxItEtYJiSCICIQiOCdh1W2MEAjXtRTLiVb8f2B4y1krAL2TBROHTo0NHeBUJKruuyIO4Rmj1DkhWrbiqJQ2ffB_idWsbwdaZYTyU_4DWEh0iZdaUo_sIlVQPqiPX4K8dhxpN6hS-FynjOaqmlSHDMC12-gSRiI2a3vW0pnzfdbZbUWkiS1ZstCMCQdLsYnKp14MJngeuw_XDx9ZbMdcnZBrxudvam_72ncXW-Vi-YHiFELVVltuPAfe27rgthnZC72TJ6_HJ3O18QJ7ipxC-bGkMnmB5J91vpr4-_T-Lpt8f4SL4fHijsPk2yIP9Gyn113YGPTGOaAsWQ3A71CCtXlRXAmS0r2YZIUelGCcGe7Z0yKdG5VBXPRi7NeCpRX221UIXd8EEV_MgP2voxuYvm8yMffB98IFDxB3UUnhuuC_Gz5gSrHTIR5XuON4v-gC9Iw8jx3d_gD58Lys-aJdLqeZNCGWrQDsBOWMWN1xdXc8FldmX51EhDAArmqnxhZQaRyJH2LohbHgJb1xOyZtWRS2ALGVE5cY-I81ri4odv9x_y1pwrn6fvyY-Rss9w-B4VgL4uMl7KN8wNOxuZvEMH6PBZiWxX25-ibJeC3hXGzJyoSMErzbMjzvyWs9ltfDc9KzKPX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