'.' or '->'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65651
91177308-0d34-0410-b5e6-
96231b3b80d8
if (Expr* E = dyn_cast_or_null<Expr>(getStmt(BR))) {
R = E->getSourceRange();
+ assert(R.isValid());
beg = &R;
end = beg+1;
}
SourceLocation BugReport::getLocation() const {
if (EndNode)
- if (Stmt* S = GetCurrentOrPreviousStmt(EndNode))
+ if (Stmt* S = GetCurrentOrPreviousStmt(EndNode)) {
+ // For member expressions, return the location of the '.' or '->'.
+ if (MemberExpr* ME = dyn_cast<MemberExpr>(S))
+ return ME->getMemberLoc();
+
return S->getLocStart();
+ }
return FullSourceLoc();
}