[cfe-commits] [cfe-dev] (Unexpected) Method type

Sean Hunt rideau3 at gmail.com
Sun Jan 10 14:39:59 PST 2010


On 01/10/2010 01:44 PM, Sebastian Redl wrote:
> But again, this is (or in the case of Clang, should be) rejected far
> earlier, namely at __typeof(h). GCC complains that the type of the
> member function is unknown. In other words, you're not allowed to apply
> typeof to a member function. I'll have to check what C++0x says about
> decltype, but I suspect it's the same thing.
>
> Sebastian

(I sent a message with much the same content to Abramo but forgot to 
send it to the list)

C++0x decltype has no special provisions for member functions. 
([dcl.type.simple]). clang implements this correctly, both Comeau and 
GCC crash. I suspect that the whole 'type is unknown' bit on __typeof is 
really a GCC bug rather than an intentional design decision, meaning 
that clang is correct in mirroring decltype's behavior.

Sean



More information about the cfe-commits mailing list