summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDeclCXX.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-11-15 22:54:20 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-11-15 22:54:20 +0000
commit2603b096df3df743c1c5fb8c988cd53aca44fdaf (patch)
treee9e5540561952ee7f153fe5472c566554046c926 /clang/lib/Parse/ParseDeclCXX.cpp
parente6385e61b57bbba1b25187a9b70f7f4213517988 (diff)
downloadbcm5719-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/lib/Parse/ParseDeclCXX.cpp')
-rw-r--r--clang/lib/Parse/ParseDeclCXX.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp
index 4cb14e24f48..0d785af3efd 100644
--- a/clang/lib/Parse/ParseDeclCXX.cpp
+++ b/clang/lib/Parse/ParseDeclCXX.cpp
@@ -1985,16 +1985,9 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
if (DS.getStorageClassSpec() == DeclSpec::SCS_typedef) {
Diag(DeclaratorInfo.getIdentifierLoc(),
diag::err_function_declared_typedef);
- // This recovery skips the entire function body. It would be nice
- // to simply call ParseCXXInlineMethodDef() below, however Sema
- // assumes the declarator represents a function, not a typedef.
- ConsumeBrace();
- SkipUntil(tok::r_brace, /*StopAtSemi*/false);
- // Consume the optional ';'
- if (Tok.is(tok::semi))
- ConsumeToken();
- return;
+ // Recover by treating the 'typedef' as spurious.
+ DS.ClearStorageClassSpecs();
}
Decl *FunDecl =
OpenPOWER on IntegriCloud