Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

confusing diagnostic for extra qualification on member #7190

Open Quuxplusone opened 13 years ago

Quuxplusone commented 13 years ago
Bugzilla Link PR9115
Status NEW
Importance P normal
Reported by Robert Reif (reif@earthlink.net)
Reported on 2011-02-01 06:10:18 -0800
Last modified on 2011-02-01 09:41:17 -0800
Version trunk
Hardware PC Linux
CC dgregor@apple.com, llvm-bugs@lists.llvm.org, rafael@espindo.la
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
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.
Quuxplusone commented 13 years ago

Microsoft compilers do accept this code without errors so MSVC mode should give no error or possibly a portability warning?