Open llvmbot opened 8 years ago
class Foo {
static const char * string;
};
#define MESSAGE_STUFF(type, string) \
const char * type::string = string;
MESSAGE_STUFF(Foo, "hello");
The original test case also still fails in the same manner.
class Foo {};
#define WHOOPS void Foo::&bar() {}
WHOOPS
I'm still seeing this on trunk. May have something to do with errors immediately after a '::'. Here's another test case exhibiting this behavior:
--
class Foo {};
#define WHOOPS void Foo::&bar() {}
WHOOPS
--
Also confirming on godbolt that I see this behavior for clang 7.0.0, 6.0.0, 5.0.0, 4.0.1, 4.0.0, 3.9.1, 3.9.0, 3.8.1, and 3.8.
3.7.1 indeed gives the proper error:
WHOOPS
^
^
1 error generated.
--
Clang trunk error:
error: expected unqualified-id
1 error generated.
--
GCC 8.2 error:
^
WHOOPS
^~
if you actually expand the macro by hand, you get a more sensible error message.
Extended Description
no filename, no line number, no nothing, except:
error: expected unqualified-id
Checking on godbolt, it seems to be a regression between 3.7.1 and 3.8.
https://godbolt.org/g/7Duczj
class Foo { static const char * string; };
define MESSAGE_STUFF(type, string) \
MESSAGE_STUFF(Foo, "hello");