[clang-tools-extra] [clang-tidy] Support special names in matchesAnyListedRegexName (PR #230353)

Zeyi Xu via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 8 21:42:42 PDT 2026


================
@@ -29,7 +29,6 @@ void TestStringViewTypes(custom::StrView sv) {
 void TestAllowedCallees(custom::StrView sv) {
   safe_func(sv.data());
   SafeClass sc(sv.data());
-  // CHECK-MESSAGES: :[[@LINE-1]]:19: warning: result of a `data()` call may not be null terminated, provide size information to the callee to prevent potential issues [bugprone-suspicious-stringview-data-usage]
----------------
zeyi2 wrote:

This seems like an pre-existing issue:

The [`AllowedCallees` documentation](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/suspicious-stringview-data-usage.html#cmdoption-arg-AllowedCallees) explicitly includes classes among the entities that can be excluded. Since this test lists the `SafeClass`, its constructor call should not produce a diagnostic once special declaration names are matched correctly. So I think this diagnostic expectation should be removed.

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


More information about the cfe-commits mailing list