summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseExpr.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2014-06-23 22:57:51 +0000
committerNick Lewycky <nicholas@mxc.ca>2014-06-23 22:57:51 +0000
commit9ea8efaf92570d708494ea352d3e5c21f0fe0ea7 (patch)
treee1d57e75b20e5c93edefef1f32adce3d9ccf1812 /clang/lib/Parse/ParseExpr.cpp
parent4377656e1236c0f29a453c3bbeb6abed51eb0d52 (diff)
downloadbcm5719-llvm-9ea8efaf92570d708494ea352d3e5c21f0fe0ea7.tar.gz
bcm5719-llvm-9ea8efaf92570d708494ea352d3e5c21f0fe0ea7.zip
Propagate isAddressOfMember into typo correction so that we don't correct &qualified-id into &unqualified-id. Also make sure to set the naming class when we find the qualified-id in a different class than the nested name specifier specified so far. Fixes PR19681!
llvm-svn: 211551
Diffstat (limited to 'clang/lib/Parse/ParseExpr.cpp')
-rw-r--r--clang/lib/Parse/ParseExpr.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp
index b2381576a2b..3fea464c688 100644
--- a/clang/lib/Parse/ParseExpr.cpp
+++ b/clang/lib/Parse/ParseExpr.cpp
@@ -435,7 +435,8 @@ class CastExpressionIdValidator : public CorrectionCandidateCallback {
if (isa<TypeDecl>(ND))
return WantTypeSpecifiers;
- return AllowNonTypes;
+ return AllowNonTypes &&
+ CorrectionCandidateCallback::ValidateCandidate(candidate);
}
private:
@@ -813,6 +814,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
SourceLocation TemplateKWLoc;
CastExpressionIdValidator Validator(isTypeCast != NotTypeCast,
isTypeCast != IsTypeCast);
+ Validator.IsAddressOfOperand = isAddressOfOperand;
Name.setIdentifier(&II, ILoc);
Res = Actions.ActOnIdExpression(getCurScope(), ScopeSpec, TemplateKWLoc,
Name, Tok.is(tok::l_paren),
OpenPOWER on IntegriCloud