<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 --- - Underlying function for template function definition has null body"
href="http://llvm.org/bugs/show_bug.cgi?id=17378">17378</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Underlying function for template function definition has null body
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.2
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows XP
</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>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>dmitrynpetrov@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>test.cpp:
template <typename T> void tmpl_fun() {}
On Windows, getTemplatedDecl()->getBody() returns nullptr for 'tmpl_fun'.
On Linux, getTemplatedDecl()->getBody() returns well-formed statement.
This affects behavior of clang-based tools.
Using Clang 3.2 final.
Windows build:
<span class="quote">> clang.exe -cc1 -ast-dump-xml test.cpp</span >
(empty output)
Linux build:
<span class="quote">> clang -cc1 -ast-dump-xml test.cpp</span >
<TranslationUnit ptr="0x31838a0">
(...)
<FunctionTemplate ptr="0x3184430" name="tmpl_fun">
<template_parameters>
<TemplateTypeParm ptr="0x3184290" name="T" typeptr="0x3184300" depth="0"
index="0"/>
</template_parameters>
<Function ptr="0x3184390" name="tmpl_fun" prototype="true">
<FunctionProtoType ptr="0x3184340" canonical="0x3184340">
<BuiltinType ptr="0x31838f0" canonical="0x31838f0"/>
<parameters/>
</FunctionProtoType>
<Stmt>
(CompoundStmt 0x3184478 <(...)/test.cpp:1:39, col:40>)
</Stmt>
</Function>
</FunctionTemplate>
</TranslationUnit></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>