================
@@ -50,8 +50,8 @@ struct testRecoverStrictnessStruct { };
#pragma clang attribute pop
-#pragma clang attribute push (__attribute__((abi_tag("a"))), apply_to =
any(function, record(unless(is_union)), variable, enum))
-// expected-error@-1 {{attribute 'abi_tag' cannot be applied to 'enum'}}
+#pragma clang attribute push (__attribute__((abi_tag("a"))), apply_to =
any(function, record(unless(is_union)), variable, enum)) // expected-warning
{{attribute 'abi_tag' cannot be applied to a 'void' parameter}}
+
// expected-error@-1
{{attribute 'abi_tag' cannot be applied to 'enum'}}
----------------
a-tarasyuk wrote:
@AaronBallman if we're considering changes to `Attr.td`, it seems that `[Var]`
and `[ParmVar]` should be extended to `AttrSubject`, since
`AttrSubjectMatcherRule` only accepts a list of `AttrSubject`. I'm unsure if
this qualifies as a `Subject`, though...
https://github.com/llvm/llvm-project/blob/50082773223b9eced296d8223ca4e4a79ecdeb9b/clang/include/clang/Basic/Attr.td#L560-L567
or explicitly add a helper to exclude void parameters and use it with
https://github.com/llvm/llvm-project/blob/d00579be39e8a470d7a0ff79ff6deadf9e003781/clang/lib/Sema/ParsedAttr.cpp#L172-L175
> Side note: pragma clang attribute push diagnostics are THE WORST here...
I suppose the diagnostic for void parameters will be skipped if the rules
exclude them, or should the diagnostic still handle this case?
https://github.com/llvm/llvm-project/pull/124920
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits