================
@@ -381,11 +381,17 @@ namespace {
class NestedNameSpecifierValidatorCCC final
: public CorrectionCandidateCallback {
public:
- explicit NestedNameSpecifierValidatorCCC(Sema &SRef)
- : SRef(SRef) {}
+ explicit NestedNameSpecifierValidatorCCC(Sema &SRef, bool HasQualifier)
+ : SRef(SRef), HasQualifier(HasQualifier) {}
bool ValidateCandidate(const TypoCorrection &candidate) override {
- return SRef.isAcceptableNestedNameSpecifier(candidate.getCorrectionDecl());
+ const NamedDecl *ND = candidate.getCorrectionDecl();
+ if (!SRef.isAcceptableNestedNameSpecifier(ND))
+ return false;
+ // A template type parameter cannot have a nested name specifier.
+ if (HasQualifier && isa<TemplateTypeParmDecl>(ND))
----------------
shafik wrote:
This has four cases but we only have one test, we should really have four tests
that cover all combinations to ensure it works as expected.
https://github.com/llvm/llvm-project/pull/181239
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits