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

Abramo Bagnara abramo.bagnara at gmail.com
Tue Jan 25 14:22:12 PST 2011


Il 25/01/2011 20:51, John McCall ha scritto:
> 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.

I'm not sure to read you right: are you saying that you believe it is an
accident the lack of CXXConstructExpr/ImplicitCastExpr for class typed
initializer or the presence of implicit casts for initializer with
builtin types?



More information about the cfe-dev mailing list