[clang] [Clang] emit -Wignored-qualifiers diagnostic for cv-qualified base classes (PR #121419)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 2 07:30:20 PST 2025


================
@@ -2655,6 +2655,15 @@ CXXBaseSpecifier *Sema::CheckBaseSpecifier(CXXRecordDecl *Class,
       return nullptr;
     }
 
+    if (BaseType.hasQualifiers() && !isa<SubstTemplateTypeParmType>(BaseType)) {
----------------
erichkeane wrote:

I think the cutout done by the `isa` is way less careful than we intend.  The base can be effectively any type-resulting-expression-like-thing, so just checking for `SubstTemplateTypeParmType` isn't nearly sufficient.  

What you are trying to do is cutout something for "used to be dependent in some way", which we don't really have a good way to check for.

https://github.com/llvm/llvm-project/pull/121419


More information about the cfe-commits mailing list