[cfe-dev] confusing diagnostic for extra qualification on member

Robert Reif reif at earthlink.net
Mon Jan 31 16:39:49 PST 2011


For this code:

class MyClass {
public:
MyClass::MyClass();
};

g++ gives:

test.cpp:3: error: extra qualification ‘MyClass::’ on member ‘MyClass’

and comeau gives:

"ComeauTest.c", line 3: error: qualified name is not allowed in member declaration
       MyClass::MyClass();

but clang++ gives:

test.cpp:3:22: error: expected member name or ';' after declaration 
specifiers
MyClass::MyClass();
~~~~~~~~~~~~~~~~ ^
1 error generated.

which is confusing.



More information about the cfe-dev mailing list