[LLVMbugs] [Bug 17378] New: Underlying function for template function definition has null body

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Sep 26 04:19:48 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=17378

            Bug ID: 17378
           Summary: Underlying function for template function definition
                    has null body
           Product: clang
           Version: 3.2
          Hardware: PC
                OS: Windows XP
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: dmitrynpetrov at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

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:
> clang.exe -cc1 -ast-dump-xml test.cpp
(empty output)

Linux build:
> clang -cc1 -ast-dump-xml test.cpp
<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>

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130926/7b4d5918/attachment.html>


More information about the llvm-bugs mailing list