r159549 / r159164 regressed clang to reject
struct s {};
struct s
operator++(struct s a)
{ return a; }
This fixes the regression. Richard, pleas check if this looks right.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172834
91177308-0d34-0410-b5e6-
96231b3b80d8
case tok::annot_template_id: // struct foo {...} a<int> ::b;
case tok::l_paren: // struct foo {...} ( x);
case tok::comma: // __builtin_offsetof(struct foo{...} ,
+ case tok::kw_operator: // struct foo operator++() {...}
return true;
case tok::colon:
return CouldBeBitfield; // enum E { ... } : 2;
typedef S() : n(1), m(2) { } // expected-error {{function definition declared 'typedef'}}
};
+
+namespace TestIsValidAfterTypeSpecifier {
+struct s {};
+
+namespace a {
+struct s operator++(struct s a)
+{ return a; }
+}
+
+namespace b {
+// The newline after s should make no difference.
+struct s
+operator++(struct s a)
+{ return a; }
+}
+
+}
+
// PR8380
extern "" // expected-error {{unknown linkage language}}
test6a { ;// expected-error {{C++ requires a type specifier for all declarations}} \