[clang] [Clang] handle [[warn_unused]] attribute for unused private fields (PR #120734)

Oleksandr T. via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 20 13:41:04 PST 2024


================
@@ -3307,6 +3307,29 @@ void Sema::CheckShadowInheritedFields(const SourceLocation &Loc,
   }
 }
 
+template <typename AttrType>
+inline static bool HasAttribute(const QualType &T) {
----------------
a-tarasyuk wrote:

@erichkeane Thanks for the detailed feedback. I just extracted this helper

https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaDeclCXX.cpp#L3596-L3602

and extended it with a template, which appears to have been added based on the following information

https://github.com/llvm/llvm-project/blob/8fce5d96a75d8c6b018e54fd4005bda01c377b56/clang/lib/Sema/SemaDeclCXX.cpp#L3596-L3602

and commit https://github.com/llvm/llvm-project/commit/a4fbc091846206fb6f5bc36115d65075764b51ea




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


More information about the cfe-commits mailing list