aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseCXXInlineMethods.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-04-14 23:19:27 +0000
committerDouglas Gregor <dgregor@apple.com>2011-04-14 23:19:27 +0000
commit87f106462ce49a4a9b812b9de92aadd4e54567bd (patch)
tree6685ddb56b458a0c25452987f4ab54ebb813cb8f /lib/Parse/ParseCXXInlineMethods.cpp
parentefdf988611c1eb02770643cd3fabd5df2f579353 (diff)
If the declaration of a C++ member function with an inline definition
is so broken that Sema can't form a declaration for it, don't bother trying to parse the definition later. Fixes <rdar://problem/9221993>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129547 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseCXXInlineMethods.cpp')
-rw-r--r--lib/Parse/ParseCXXInlineMethods.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Parse/ParseCXXInlineMethods.cpp b/lib/Parse/ParseCXXInlineMethods.cpp
index fc1902ca7f..93568efebc 100644
--- a/lib/Parse/ParseCXXInlineMethods.cpp
+++ b/lib/Parse/ParseCXXInlineMethods.cpp
@@ -87,6 +87,14 @@ Decl *Parser::ParseCXXInlineMethodDef(AccessSpecifier AS, ParsingDeclarator &D,
}
}
+
+ if (!FnD) {
+ // If semantic analysis could not build a function declaration,
+ // just throw away the late-parsed declaration.
+ delete getCurrentClass().LateParsedDeclarations.back();
+ getCurrentClass().LateParsedDeclarations.pop_back();
+ }
+
return FnD;
}