aboutsummaryrefslogtreecommitdiff
path: root/lib
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
commit6f9a445760992a6fbff2c0b08becf35ae9eafa71 (patch)
tree7dbf7f92a976e820410f2f3d1c8f6e93e257c6b3 /lib
parentf0024960d5f9edc5728128b49cb758e689dd3746 (diff)
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! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168108 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Parse/ParseDeclCXX.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp
index 4cb14e24f4..0d785af3ef 100644
--- a/lib/Parse/ParseDeclCXX.cpp
+++ b/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 =