diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-08-12 01:46:03 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-08-12 01:46:03 +0000 |
commit | 6c716116dfc8655aec56b5f6cd7a3c99165d86bb (patch) | |
tree | 0aa9c9e4da4052c3bcbe73a609ddc354a256bf6c /clang/lib/AST/DeclCXX.cpp | |
parent | 4164dd9167f2f049e2a5e1bd3970a6bb45889462 (diff) | |
download | bcm5719-llvm-6c716116dfc8655aec56b5f6cd7a3c99165d86bb.tar.gz bcm5719-llvm-6c716116dfc8655aec56b5f6cd7a3c99165d86bb.zip |
PR34163: Don't cache an incorrect key function for a class if queried between
the class becoming complete and its inline methods being parsed.
This replaces the hack of using the "late parsed template" flag to track member
functions with bodies we've not parsed yet; instead we now use the "will have
body" flag, which carries the desired implication that the function declaration
*is* a definition, and that we've just not parsed its body yet.
llvm-svn: 310776
Diffstat (limited to 'clang/lib/AST/DeclCXX.cpp')
-rw-r--r-- | clang/lib/AST/DeclCXX.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp index 5cab4888225..1caceab85ee 100644 --- a/clang/lib/AST/DeclCXX.cpp +++ b/clang/lib/AST/DeclCXX.cpp @@ -1837,9 +1837,10 @@ bool CXXMethodDecl::hasInlineBody() const { const FunctionDecl *CheckFn = getTemplateInstantiationPattern(); if (!CheckFn) CheckFn = this; - + const FunctionDecl *fn; - return CheckFn->hasBody(fn) && !fn->isOutOfLine(); + return CheckFn->isDefined(fn) && !fn->isOutOfLine() && + (fn->doesThisDeclarationHaveABody() || fn->willHaveBody()); } bool CXXMethodDecl::isLambdaStaticInvoker() const { |