<html>
<head>
<base href="http://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 --- - No AST representation for extern template instantiations"
href="http://llvm.org/bugs/show_bug.cgi?id=20666">20666</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>No AST representation for extern template instantiations
</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>Linux
</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>C++11
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>eliben@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Explicit (extern) template declarations have no representation in the AST:
template <typename T>
int __ostream_insert() {
return 0;
}
extern template int __ostream_insert<char>();
template<> int __ostream_insert<long>() {
return 1;
}
Produces:
TranslationUnitDecl 0x3763300 <<invalid sloc>> <invalid sloc>
|-TypedefDecl 0x3763840 <<invalid sloc>> <invalid sloc> implicit __int128_t
'__int128'
|-TypedefDecl 0x37638a0 <<invalid sloc>> <invalid sloc> implicit
__uint128_t 'unsigned __int128'
|-TypedefDecl 0x3763c60 <<invalid sloc>> <invalid sloc> implicit
__builtin_va_list '__va_list_tag [1]'
|-FunctionTemplateDecl 0x3763e50 </tmp/jp.cpp:1:3, line:4:3> line:2:7
__ostream_insert
| |-TemplateTypeParmDecl 0x3763cb0 <line:1:13, col:22> col:22 typename T
| |-FunctionDecl 0x3763db0 <line:2:3, line:4:3> line:2:7 __ostream_insert
'int (void)'
| | `-CompoundStmt 0x3763ed8 <col:26, line:4:3>
| | `-ReturnStmt 0x3763eb8 <line:3:5, col:12>
| | `-IntegerLiteral 0x3763e98 <col:12> 'int' 0
| |-FunctionDecl 0x37a4f60 <line:2:3, line:4:3> line:2:7 __ostream_insert
'int (void)'
| | `-TemplateArgument type 'char'
| `-Function 0x37a50a0 '__ostream_insert' 'int (void)'
`-FunctionDecl 0x37a50a0 prev 0x37a51c0 <line:8:3, line:10:3> line:8:18
__ostream_insert 'int (void)'
|-TemplateArgument type 'long'
`-CompoundStmt 0x37a5380 <col:43, line:10:3>
`-ReturnStmt 0x37a5360 <line:9:5, col:12>
`-IntegerLiteral 0x37a5340 <col:12> 'int' 1
It appears as a child of the FunctionTemplateDecl:
| |-FunctionDecl 0x37a4f60 <line:2:3, line:4:3> line:2:7 __ostream_insert
'int (void)'
| | `-TemplateArgument type 'char'
But the source location is incorrect (points to the parent template, not the
extern instantiation.</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>