================
@@ -43,10 +43,11 @@ void 
StdNamespaceModificationCheck::registerMatchers(MatchFinder *Finder) {
       hasDeclContext(namespaceDecl(hasAnyName("std", "posix"),
                                    unless(hasParent(namespaceDecl())))
                          .bind("nmspc"));
-  auto UserDefinedType = qualType(
-      hasUnqualifiedDesugaredType(tagType(unless(hasDeclaration(tagDecl(
-          hasAncestor(namespaceDecl(hasAnyName("std", "posix"),
-                                    unless(hasParent(namespaceDecl()))))))))));
+  auto UserDefinedDecl = tagDecl(hasAncestor(namespaceDecl(
----------------
zeyi2 wrote:

Can we also match `classTemplateDecl()` in `UserDefinedDecl`? By doing this we 
can find UBs like `std::hash<vector<T>>`. (The original check can find this 
before, so IMO this might be a subtle regression, it would be nice if we can 
add tests for them?)

Repro: https://clang-tidy.godbolt.org/z/YE3GKPKeb

https://github.com/llvm/llvm-project/pull/183984
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to