summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorSerge Pavlov <sepavloff@gmail.com>2013-08-10 12:00:21 +0000
committerSerge Pavlov <sepavloff@gmail.com>2013-08-10 12:00:21 +0000
commit074a518f03cb8a2254796b86268e473b8f739dd3 (patch)
treef09110910cda0bb4ec70e720624e3a29ba816de2 /clang/lib/Sema
parentd3a039fed2c36d735ae4bbd43e0934d0303226af (diff)
downloadbcm5719-llvm-074a518f03cb8a2254796b86268e473b8f739dd3.tar.gz
bcm5719-llvm-074a518f03cb8a2254796b86268e473b8f739dd3.zip
Fix to PR16225 (Assert-on-invalid: isa<LabelDecl>(D) && "declaration not instantiated in this scope")
Differential Revision: http://llvm-reviews.chandlerc.com/D920 llvm-svn: 188137
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiateDecl.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index ce7684c9edb..315a405c6d3 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -4063,6 +4063,9 @@ NamedDecl *Sema::FindInstantiatedDecl(SourceLocation Loc, NamedDecl *D,
isa<TemplateTemplateParmDecl>(D))
return D;
+ if (D->isInvalidDecl())
+ return 0;
+
// If we didn't find the decl, then we must have a label decl that hasn't
// been found yet. Lazily instantiate it and return it now.
assert(isa<LabelDecl>(D));
OpenPOWER on IntegriCloud