diff options
author | Nico Weber <nicolasweber@gmx.de> | 2013-01-18 18:41:42 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2013-01-18 18:41:42 +0000 |
commit | 55fc3a767b9945bd1f311f2339dcaa8761da5661 (patch) | |
tree | 3dff452ff14282a53df858b08815d557cebafe47 /test/Parser/cxx-decl.cpp | |
parent | e02be97811c785f91ac43a0feed2db862de1867f (diff) |
Fix parsing of class specifiers before '\n' 'operator'.
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
Diffstat (limited to 'test/Parser/cxx-decl.cpp')
-rw-r--r-- | test/Parser/cxx-decl.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Parser/cxx-decl.cpp b/test/Parser/cxx-decl.cpp index 5a4c9da0f6..aa775c8c76 100644 --- a/test/Parser/cxx-decl.cpp +++ b/test/Parser/cxx-decl.cpp @@ -132,6 +132,24 @@ struct S { 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}} \ |