[cfe-commits] r60331 - /cfe/trunk/test/Sema/i-c-e3.c

Neil Booth neil at daikokuya.co.uk
Tue Dec 2 05:27:17 PST 2008


Anders Carlsson wrote:-

>>> Ah, I see - I got ICEs and regular constant expressions mixed up.
>>
>> The 'a' is not permitted in a "regular constant expression" either.
>
> Hmm, why not?

No, wrong question, it should be "what right does it have to be?" :)

6.6p7 states the semantics of constant expressions in initializers,
of which this is one.  It is none of the four because of the "a".

This is only semantics, not a constraint, so an implementation
can accept other stuff as extensions, but I don't believe you were
writing extensions.

By the flip side of the coin, your expression doesn't violate a
constraint, but nor does it follow the semantics of the language,
so a conforming implementation has no requirement to accept your
expression.  Many don't.

Neil.



More information about the cfe-commits mailing list