File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -1040,16 +1040,11 @@ class ExplicitReferenceCollector
10401040 if (auto *S = N.get <Stmt>())
10411041 return refInStmt (S, Resolver);
10421042 if (auto *NNSL = N.get <NestedNameSpecifierLoc>()) {
1043+ if (auto TL = NNSL->getAsTypeLoc ())
1044+ return refInTypeLoc (NNSL->getAsTypeLoc (), Resolver);
10431045 // (!) 'DeclRelation::Alias' ensures we do not lose namespace aliases.
1044- NestedNameSpecifierLoc Qualifier;
1045- SourceLocation NameLoc;
1046- if (auto TL = NNSL->getAsTypeLoc ()) {
1047- Qualifier = TL.getPrefix ();
1048- NameLoc = TL.getNonPrefixBeginLoc ();
1049- } else {
1050- Qualifier = NNSL->getAsNamespaceAndPrefix ().Prefix ;
1051- NameLoc = NNSL->getLocalBeginLoc ();
1052- }
1046+ NestedNameSpecifierLoc Qualifier = NNSL->getAsNamespaceAndPrefix ().Prefix ;
1047+ SourceLocation NameLoc = NNSL->getLocalBeginLoc ();
10531048 return {
10541049 ReferenceLoc{Qualifier, NameLoc, false ,
10551050 explicitReferenceTargets (
Original file line number Diff line number Diff line change @@ -361,6 +361,9 @@ class NestedNameSpecifierLoc {
361361 // / Retrieve the source range covering just the last part of
362362 // / this nested-name-specifier, not including the prefix.
363363 // /
364+ // / Note that this is the source range of this NestedNameSpecifier chunk,
365+ // and for a type this includes the prefix of that type.
366+ // /
364367 // / For example, if this instance refers to a nested-name-specifier
365368 // / \c \::std::vector<int>::, the returned source range would cover
366369 // / from "vector" to the last '::'.
You can’t perform that action at this time.
0 commit comments