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 | 0bba2d11d08e7cf6c9e475cb6736395a10a95872 (patch) | |
| tree | b33a4eb7ff78223b3cf44ddce73978f719d7da71 /clang/test/Parser/cxx-decl.cpp | |
| parent | 1dc394038363dba10aec20e337f0ae077dce8f60 (diff) | |
| download | bcm5719-llvm-0bba2d11d08e7cf6c9e475cb6736395a10a95872.tar.gz bcm5719-llvm-0bba2d11d08e7cf6c9e475cb6736395a10a95872.zip | |
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.
llvm-svn: 172834
Diffstat (limited to 'clang/test/Parser/cxx-decl.cpp')
| -rw-r--r-- | clang/test/Parser/cxx-decl.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/Parser/cxx-decl.cpp b/clang/test/Parser/cxx-decl.cpp index 5a4c9da0f60..aa775c8c762 100644 --- a/clang/test/Parser/cxx-decl.cpp +++ b/clang/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}} \ |

