aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Sema/SemaExpr.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index b69e1fbcd6..b32c684019 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -2184,6 +2184,12 @@ Sema::BuildMemberReferenceExpr(Scope *S, ExprArg Base, SourceLocation OpLoc,
// If the member name was a qualified-id, look into the
// nested-name-specifier.
DC = computeDeclContext(*SS, false);
+
+ if (!isa<TypeDecl>(DC)) {
+ Diag(MemberLoc, diag::err_qualified_member_nonclass)
+ << DC << SS->getRange();
+ return ExprError();
+ }
// FIXME: If DC is not computable, we should build a
// CXXUnresolvedMemberExpr.