From 2603b096df3df743c1c5fb8c988cd53aca44fdaf Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 15 Nov 2012 22:54:20 +0000 Subject: 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 --- clang/lib/Parse/ParseDeclCXX.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'clang/lib/Parse/ParseDeclCXX.cpp') 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 = -- cgit v1.2.3