summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-04-28 07:04:26 +0000
committerDouglas Gregor <dgregor@apple.com>2010-04-28 07:04:26 +0000
commita02bb341552b2b91c93e708645c32d11cc4133d2 (patch)
tree55a984bf08f90f6012e3c3cf4e72f92398e59fdc /clang/lib/Sema/SemaExpr.cpp
parent7988def89f71dac552335a17c31b847e5a3189ea (diff)
downloadbcm5719-llvm-a02bb341552b2b91c93e708645c32d11cc4133d2.tar.gz
bcm5719-llvm-a02bb341552b2b91c93e708645c32d11cc4133d2.zip
When the qualifier of a id-expression is non-dependent but not
complete, return an error rather than falling back to building a dependent declaration reference, since we might not be in a dependent context. Fixes a fiendish crash-on-invalid in Boost.FunctionTypes that I wasn't able to reduce to anything useful. llvm-svn: 102491
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 89a329140fa..bdd1cfb66b8 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -1232,11 +1232,12 @@ Sema::BuildQualifiedDeclarationNameExpr(CXXScopeSpec &SS,
DeclarationName Name,
SourceLocation NameLoc) {
DeclContext *DC;
- if (!(DC = computeDeclContext(SS, false)) ||
- DC->isDependentContext() ||
- RequireCompleteDeclContext(SS))
+ if (!(DC = computeDeclContext(SS, false)) || DC->isDependentContext())
return BuildDependentDeclRefExpr(SS, Name, NameLoc, 0);
+ if (RequireCompleteDeclContext(SS))
+ return ExprError();
+
LookupResult R(*this, Name, NameLoc, LookupOrdinaryName);
LookupQualifiedName(R, DC);
OpenPOWER on IntegriCloud