[cfe-dev] InitListExpr::getSyntacticForm and C++

John McCall rjmccall at apple.com
Tue Jan 25 11:51:20 PST 2011


On Jan 25, 2011, at 11:49 AM, Abramo Bagnara wrote:
> Il 25/01/2011 20:37, John McCall ha scritto:
>> On Jan 25, 2011, at 11:18 AM, Abramo Bagnara wrote:
>>> I've just verified that in:
>>> 
>>> class C {
>>> public:
>>> C(int a);
>>> };
>>> 
>>> C v[3] = {1,2,3.0};
>>> 
>>> the InitListExpr returned by InitListExpr::getSyntacticForm misses all
>>> the fundamental info about implicit casts and CXXConstructExpr.
>>> 
>>> Is this deliberate (why?) or it is a bug to fix?
>> 
>> Does the syntactic form normally have any of this stuff?  I thought it was just the initializer list as it was written in the source, without further analysis or comment.
> 
> As you can see from the typescript above, implicit casts are where they
> are expected, but AST is without CXXConstructExpr and implicit cast when
> initialized type is a class.

I think that's more an accident than anything else.

John.



More information about the cfe-dev mailing list