[LLVMbugs] [Bug 17040] New: -fdelayed-template-parsing with -fms-extensions creates a bad AST

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Aug 29 20:51:32 PDT 2013


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

            Bug ID: 17040
           Summary: -fdelayed-template-parsing with -fms-extensions
                    creates a bad AST
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: david.majnemer at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

consider:
struct Type {
  template <int i>
  static void Foo() {}
  template <>
  void Foo<0>() {}
};

void call() { Type::Foo<0>(); }

run:
clang -cc1 /var/tmp/stranger.cpp -fdelayed-template-parsing -fms-extensions
-ast-dump

The AST looks like:
TranslationUnitDecl 0x5717a90 <<invalid sloc>>
|-TypedefDecl 0x5717fd0 <<invalid sloc>> __int128_t '__int128'
|-TypedefDecl 0x5718030 <<invalid sloc>> __uint128_t 'unsigned __int128'
|-TypedefDecl 0x57183f0 <<invalid sloc>> __builtin_va_list '__va_list_tag [1]'
|-CXXRecordDecl 0x5718440 <<built-in>:28:1, col:7> class type_info
|-CXXRecordDecl 0x57184f0 </var/tmp/stranger.cpp:1:1, line:6:1> struct Type
| |-CXXRecordDecl 0x5718600 <line:1:1, col:8> struct Type
| |-FunctionTemplateDecl 0x574b3f0 <line:2:3, line:3:19> Foo
| | |-NonTypeTemplateParmDecl 0x57186a0 <line:2:13, col:17> 'int' i
| | |-CXXMethodDecl 0x574b350 <line:3:3, col:19> Foo 'void (void)' static
| | | `-<<<NULL>>>
| | `-CXXMethod 0x574b490 'Foo' 'void (void)'
| `-CXXMethodDecl 0x574b490 prev 0x574b640 <line:4:3, line:5:15> Foo 'void
(void)'
|   |-TemplateArgument integral 0
|   `-<<<NULL>>>
`-FunctionDecl 0x574b7e0 <line:8:1, col:31> call 'void (void)'
  `-CompoundStmt 0x574bb08 <col:13, col:31>
    `-CallExpr 0x574bae0 <col:15, col:28> 'void'
      `-ImplicitCastExpr 0x574bac8 <col:15, col:26> 'void (*)(void)'
<FunctionToPointerDecay>
        `-DeclRefExpr 0x574ba10 <col:15, col:26> 'void (void)' lvalue CXXMethod
0x574b490 'Foo' 'void (void)' (FunctionTemplate 0x574b3f0 'Foo')

-- 
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/20130830/1d7bd821/attachment.html>


More information about the llvm-bugs mailing list