RangeInfo: Report RValue type if a decl reference is of read-only LValue type. (#8300)

This commit is contained in:
Xi Ge
2017-03-23 15:52:54 -07:00
committed by GitHub
parent f7562e42b6
commit 1827fb1436
11 changed files with 77 additions and 44 deletions

View File

@@ -777,7 +777,7 @@ public:
bool visitDeclReference(ValueDecl *D, CharSourceRange Range,
TypeDecl *CtorTyRef, ExtensionDecl *ExtTyRef, Type T,
SemaReferenceKind Kind) override {
ReferenceMetaData Data) override {
if (isa<VarDecl>(D) && D->hasName() && D->getName().str() == "self")
return true;
@@ -795,7 +795,7 @@ public:
bool IsOpenBracket) override {
// We should treat both open and close brackets equally
return visitDeclReference(D, Range, nullptr, nullptr, Type(),
SemaReferenceKind::SubscriptRef);
ReferenceMetaData(SemaReferenceKind::SubscriptRef, None));
}
void annotate(const Decl *D, bool IsRef, CharSourceRange Range) {