[LLVMbugs] [Bug 22367] New: Incomplete AST related to std::initializer_list

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jan 28 02:24:20 PST 2015


            Bug ID: 22367
           Summary: Incomplete AST related to std::initializer_list
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: abramo.bagnara at bugseng.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

For the following source:

#include <initializer_list>
typedef std::initializer_list<int> T;

void f(T);

template <typename U>
void g(U);

int main() {

We get this AST (initial part is omitted as it is not relevant):

`-FunctionDecl 0x7960cc0 <line:9:1, line:12:1> line:9:5 main 'int (void)'
  `-CompoundStmt 0x7962d50 <col:12, line:12:1>
    |-CallExpr 0x7962180 <line:10:3, col:9> 'void'
    | |-ImplicitCastExpr 0x7962168 <col:3> 'void (*)(T)'
    | | `-DeclRefExpr 0x79620e0 <col:3> 'void (T)' lvalue Function
0x7960940 'f' 'void (T)'
    | `-CXXConstructExpr 0x79627a8 <col:6, col:8> 'T':'class
std::initializer_list<int>' 'void (class std::initializer_list<int> &&)
noexcept' elidable
    |   `-MaterializeTemporaryExpr 0x7962550 <col:6, col:8> 'class
std::initializer_list<int>' xvalue
    |     `-CXXStdInitializerListExpr 0x7961fa8 <col:6, col:8>
'T':'class std::initializer_list<int>'
    |       `-MaterializeTemporaryExpr 0x7961f90 <col:6, col:8> 'const
int [1]' xvalue
    |         `-InitListExpr 0x7961f48 <col:6, col:8> 'const int [1]'
    |           `-IntegerLiteral 0x7960e20 <col:7> 'int' 0
    `-CallExpr 0x7962cd0 <line:11:3, col:9> 'void'
      |-ImplicitCastExpr 0x7962cb8 <col:3> 'void (*)(class
std::initializer_list<int>)' <FunctionToPointerDecay>
      | `-DeclRefExpr 0x7962c60 <col:3> 'void (class
std::initializer_list<int>)' lvalue Function 0x7962b60 'g' 'void (class
std::initializer_list<int>)' (FunctionTemplate 0x7960c20 'g')
      `-CXXConstructExpr 0x7962d18 <col:6, col:8> 'class
std::initializer_list<int>':'class std::initializer_list<int>' 'void
(class std::initializer_list<int> &&) noexcept' elidable
        `-MaterializeTemporaryExpr 0x7962d00 <col:6, col:8> 'class
std::initializer_list<int>' xvalue
          `-CXXStdInitializerListExpr 0x7962910 <col:6, col:8>
'T':'class std::initializer_list<int>'
            `-MaterializeTemporaryExpr 0x79628f8 <col:6, col:8> 'const
int [1]' xvalue
              `-InitListExpr 0x79628b0 <col:6, col:8> 'const int [1]'
                `-IntegerLiteral 0x7962848 <col:7> 'int' 0

This misses any reference to TypeLoc for T.



Richard Smith points that a NoOp CXXFunctionalCastExpr is missing between
MaterializeTemporaryExpr and CXXStdInitializerListExpr.

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/20150128/91787f3f/attachment.html>

More information about the llvm-bugs mailing list