Missing info in AST for CXXConstructExpr

Abramo Bagnara abramo.bagnara at bugseng.com
Wed Jan 28 02:27:09 PST 2015


Il 27/01/2015 02:50, Richard Smith ha scritto:

> 
> There should be a CXXFunctionalCastExpr (with cast kind CK_NoOp) between
> the MaterializeTemporaryExpr and its contained CXXStdInitializerListExpr:
> 
>     `-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 [...]
>       `-CXXConstructExpr 0x7962d18 <col:6, col:8> [...]
>         `-MaterializeTemporaryExpr 0x7962d00 <col:6, col:8>
> 'class std::initializer_list<int>' xvalue
> *          `-CXXFunctionalCastExpr 0x... <NoOp>
> *            `-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 case appears to be missing from Sema::BuildCXXTypeConstructExpr; it
> looks like it assumes that initialization will give us either a
> CXXConstructExpr or an InitListExpr.

Filed as http://llvm.org/bugs/show_bug.cgi?id=22367 with reference to
your proposed solution.


-- 
Abramo Bagnara

BUGSENG srl - http://bugseng.com
mailto:abramo.bagnara at bugseng.com



More information about the cfe-commits mailing list