зеркало из https://github.com/microsoft/clang-1.git
Fixed range of implicit MemberExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167581 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
ef7bceadf4
Коммит
13fd684ee2
|
@ -1327,9 +1327,12 @@ SourceLocation MemberExpr::getLocStart() const {
|
|||
return MemberLoc;
|
||||
}
|
||||
SourceLocation MemberExpr::getLocEnd() const {
|
||||
SourceLocation EndLoc = getMemberNameInfo().getEndLoc();
|
||||
if (hasExplicitTemplateArgs())
|
||||
return getRAngleLoc();
|
||||
return getMemberNameInfo().getEndLoc();
|
||||
EndLoc = getRAngleLoc();
|
||||
else if (EndLoc.isInvalid())
|
||||
EndLoc = getBase()->getLocEnd();
|
||||
return EndLoc;
|
||||
}
|
||||
|
||||
void CastExpr::CheckCastConsistency() const {
|
||||
|
|
|
@ -254,5 +254,13 @@ TEST(CXXNewExpr, ArrayRange) {
|
|||
EXPECT_TRUE(Verifier.match("void f() { new int[10]; }", newExpr()));
|
||||
}
|
||||
|
||||
TEST(MemberExpr, ImplicitMemberRange) {
|
||||
RangeVerifier<MemberExpr> Verifier;
|
||||
Verifier.expectRange(2, 30, 2, 30);
|
||||
EXPECT_TRUE(Verifier.match("struct S { operator int() const; };\n"
|
||||
"int foo(const S& s) { return s; }",
|
||||
memberExpr()));
|
||||
}
|
||||
|
||||
} // end namespace ast_matchers
|
||||
} // end namespace clang
|
||||
|
|
Загрузка…
Ссылка в новой задаче