<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - C++ Debug info should reference DW_TAG_template_type_parameter"
href="https://llvm.org/bugs/show_bug.cgi?id=26553">26553</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>C++ Debug info should reference DW_TAG_template_type_parameter
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>LLVM Codegen
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>aprantl@apple.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>The DWARF standard recommends the debug info for the following snippet:
Figure D.50: C++ template example #1: source
// C++ source
//
template <class T> struct wrapper {
T comp;
};
wrapper<int> obj;
to be emitted as:
! DWARF description
!
11$: DW_TAG_structure_type
DW_AT_name("wrapper")
12$: DW_TAG_template_type_parameter
DW_AT_name("T")
DW_AT_type(reference to "int")
13$: DW_TAG_member
DW_AT_name("comp")
DW_AT_type(reference to 12$)
^^^^^^^^^^^^^^^^
The type of comp is T.
14$: DW_TAG_variable
DW_AT_name("obj")
DW_AT_type(reference to 11$)
what clang r260113 is actually emitting is
0x00000034: TAG_structure_type [3] *
AT_name( "wrapper<int>" )
AT_byte_size( 0x04 )
AT_decl_file( "/private/tmp/template.cpp" )
AT_decl_line( 4 )
0x0000003c: TAG_member [4]
AT_name( "comp" )
AT_type( {0x00000054} ( int ) )
^^^^^
The type of comp is int.
AT_decl_file( "/private/tmp/template.cpp" )
AT_decl_line( 5 )
AT_data_member_location( +0 )
0x0000004a: TAG_template_type_parameter [5]
AT_type( {0x00000054} ( int ) )
AT_name( "T" )
0x00000053: NULL
0x00000054: TAG_base_type [6]
AT_name( "int" )
AT_encoding( DW_ATE_signed )
AT_byte_size( 0x04 )</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>