================
@@ -822,6 +822,7 @@ def NSobjectAttribute : DiagGroup<"NSObject-attribute">;
 def NSConsumedMismatch : DiagGroup<"nsconsumed-mismatch">;
 def NSReturnsMismatch : DiagGroup<"nsreturns-mismatch">;
 
+def UnknownAttributeNamespaces : DiagGroup<"unknown-attribute-namespaces">;
 def IndependentClassAttribute : DiagGroup<"IndependentClass-attribute">;
 def UnknownAttributes : DiagGroup<"unknown-attributes">;
----------------
AaronBallman wrote:

I think the warning group makes sense to add to `UnknownAttributes` because I 
think the behavior we want is:
```
// -Wunknow-attributes; tell me about all kinds of unknown attributes
[[frob::foo]][[gnu::fd_arg]] void func();
// warning: unknown attribute namespace 'frob'; attribute 'frob::foo' ignored 
[-Wuknown-attribute-namespaces]
// warning: unknown attribute 'fd_arg' ignored [-Wunknown-attributes]

// -Wunknown-attributes -Wno-unknown-attribute-namespaces; only tell me about 
unknown attributes in a known attribute namespace
[[frob::foo]][[gnu::fd_arg]] void func();
// warning: unknown attribute 'foo' ignored [-Wuknown-attributes]

// -Wno-unknown-attributes -Wunknown-attribute-namespaces; only tell me about 
unknown attribute namespaces
[[frob::foo]][[gnu::fd_arg]] void func();
// warning: unknown attribute namespace 'frob'; attribute 'frob::foo' ignored 
[-Wuknown-attribute-namespaces]

// -Wno-unknown-attributes; don't tell me about unknown attributes at all
[[frob::foo]][[gnu::fd_arg]] void func(); // no warnings
```
WDYT? If you agree, this would be a pretty useful test case to add.

https://github.com/llvm/llvm-project/pull/120925
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to