diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-15 22:54:20 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-15 22:54:20 +0000 |
| commit | 2603b096df3df743c1c5fb8c988cd53aca44fdaf (patch) | |
| tree | e9e5540561952ee7f153fe5472c566554046c926 /clang/test/Parser/cxx-decl.cpp | |
| parent | e6385e61b57bbba1b25187a9b70f7f4213517988 (diff) | |
| download | bcm5719-llvm-2603b096df3df743c1c5fb8c988cd53aca44fdaf.tar.gz bcm5719-llvm-2603b096df3df743c1c5fb8c988cd53aca44fdaf.zip | |
PR9903: Recover from a member functon declared with the 'typedef' specifier by
dropping the specifier, just like we do for non-member functions and function
templates declared 'typedef'. Patch by Brian Brooks!
llvm-svn: 168108
Diffstat (limited to 'clang/test/Parser/cxx-decl.cpp')
| -rw-r--r-- | clang/test/Parser/cxx-decl.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/test/Parser/cxx-decl.cpp b/clang/test/Parser/cxx-decl.cpp index 290b947de2b..5a4c9da0f60 100644 --- a/clang/test/Parser/cxx-decl.cpp +++ b/clang/test/Parser/cxx-decl.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -verify -fsyntax-only -triple i386-linux -pedantic %s +// RUN: %clang_cc1 -verify -fsyntax-only -triple i386-linux -pedantic -fcxx-exceptions -fexceptions %s const char const *x10; // expected-warning {{duplicate 'const' declaration specifier}} @@ -124,6 +124,14 @@ void CodeCompleteConsumer::() { // expected-error {{xpected unqualified-id}} // PR4111 void f(sqrgl); // expected-error {{unknown type name 'sqrgl'}} +// PR9903 +struct S { + typedef void a() { }; // expected-error {{function definition declared 'typedef'}} + typedef void c() try { } catch(...) { } // expected-error {{function definition declared 'typedef'}} + int n, m; + typedef S() : n(1), m(2) { } // expected-error {{function definition declared 'typedef'}} +}; + // PR8380 extern "" // expected-error {{unknown linkage language}} test6a { ;// expected-error {{C++ requires a type specifier for all declarations}} \ |

