summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprMember.cpp
diff options
context:
space:
mode:
authorMatt Beaumont-Gay <matthewbg@google.com>2012-04-21 01:12:48 +0000
committerMatt Beaumont-Gay <matthewbg@google.com>2012-04-21 01:12:48 +0000
commitd9f244afbbca105b644798902606f2e59e2ebd84 (patch)
tree9316c67ba3f7d6453e7f344e19be1b8e4b9f453c /clang/lib/Sema/SemaExprMember.cpp
parent910667004fee8b876b16e6d1a0b88538b4b53959 (diff)
downloadbcm5719-llvm-d9f244afbbca105b644798902606f2e59e2ebd84.tar.gz
bcm5719-llvm-d9f244afbbca105b644798902606f2e59e2ebd84.zip
Fix a QoI bug reported by a user.
Set the source location for the "member reference base type ... is not a structure or union" diag to point at the operator rather than the member name. If we're giving this diagnostic because of a typo'd '.' in place of a ';' at the end of a line, the caret previously pointed at the identifier on the following line, which isn't as helpful as it could be. Pointing the caret at the '.' makes it more obvious what the problem is. llvm-svn: 155267
Diffstat (limited to 'clang/lib/Sema/SemaExprMember.cpp')
-rw-r--r--clang/lib/Sema/SemaExprMember.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaExprMember.cpp b/clang/lib/Sema/SemaExprMember.cpp
index 6c84caa3f37..bebb498b640 100644
--- a/clang/lib/Sema/SemaExprMember.cpp
+++ b/clang/lib/Sema/SemaExprMember.cpp
@@ -436,7 +436,7 @@ Sema::ActOnDependentMemberExpr(Expr *BaseExpr, QualType BaseType,
if (PT && (!getLangOpts().ObjC1 ||
PT->getPointeeType()->isRecordType())) {
assert(BaseExpr && "cannot happen with implicit member accesses");
- Diag(NameInfo.getLoc(), diag::err_typecheck_member_reference_struct_union)
+ Diag(OpLoc, diag::err_typecheck_member_reference_struct_union)
<< BaseType << BaseExpr->getSourceRange();
return ExprError();
}
@@ -1418,7 +1418,7 @@ Sema::LookupMemberExpr(LookupResult &R, ExprResult &BaseExpr,
ObjCImpDecl, HasTemplateArgs);
}
- Diag(MemberLoc, diag::err_typecheck_member_reference_struct_union)
+ Diag(OpLoc, diag::err_typecheck_member_reference_struct_union)
<< BaseType << BaseExpr.get()->getSourceRange();
return ExprError();
OpenPOWER on IntegriCloud