[cfe-commits] [PATCH] C++0x strongly typed enums

Sean Hunt scshunt at csclub.uwaterloo.ca
Tue Oct 12 08:05:06 PDT 2010

On 10/12/2010 08:45 AM, Daniel Wallin wrote:
> int() is a integral constant expression and the above code is well
> formed in C++98, and I think it's meant to be in C++0x as well. There
> isn't really an ambiguity here because base-type must be an integral
> type, which of course X() can never satisfy. If we treat everything as
> a type-id the case Doug gave above is ill formed.

According to 8.2/2, "... any construct that could possibly be a type-id 
in its syntatic context, shall be considered a type-id." This rule 
applies even when the result is ill-formed, such as with sizeof(int()).


More information about the cfe-commits mailing list