summaryrefslogtreecommitdiffstats
path: root/clang/lib
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
commit6ca6410e3ac1bc29ae8c39756653943f8a7ed1d1 (patch)
tree6d86835a3dbe7e95141d3e07084a31e5cb1d1ace /clang/lib
parent2395626605b7844fef6a87bfb666f8be40e3afa6 (diff)
downloadbcm5719-llvm-6ca6410e3ac1bc29ae8c39756653943f8a7ed1d1.tar.gz
bcm5719-llvm-6ca6410e3ac1bc29ae8c39756653943f8a7ed1d1.zip
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>. llvm-svn: 129547
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Parse/ParseCXXInlineMethods.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseCXXInlineMethods.cpp b/clang/lib/Parse/ParseCXXInlineMethods.cpp
index fc1902ca7fd..93568efebc0 100644
--- a/clang/lib/Parse/ParseCXXInlineMethods.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud