On Fri, 6 Sept 2024 at 20:17, Jason Merrill wrote:
>
> On 9/6/24 8:56 AM, Jonathan Wakely wrote:
> > On 05/09/24 21:44 -0400, Jason Merrill wrote:
> >> On 9/4/24 11:02 AM, Marek Polacek wrote:
> +handle_flag_enum_attribute (tree *node, tree ARG_UNUSED(name), tree
> args,
> +
On 9/6/24 8:56 AM, Jonathan Wakely wrote:
On 05/09/24 21:44 -0400, Jason Merrill wrote:
On 9/4/24 11:02 AM, Marek Polacek wrote:
+handle_flag_enum_attribute (tree *node, tree ARG_UNUSED(name), tree
args,
+ int ARG_UNUSED (flags), bool *no_add_attrs)
+{
+ if (args)
+ warning
On 05/09/24 21:44 -0400, Jason Merrill wrote:
On 9/4/24 11:02 AM, Marek Polacek wrote:
+handle_flag_enum_attribute (tree *node, tree ARG_UNUSED(name), tree args,
+ int ARG_UNUSED (flags), bool *no_add_attrs)
+{
+ if (args)
+warning (OPT_Wattributes, "%qE attribute
On 9/4/24 11:02 AM, Marek Polacek wrote:
+handle_flag_enum_attribute (tree *node, tree ARG_UNUSED(name), tree args,
+ int ARG_UNUSED (flags), bool *no_add_attrs)
+{
+ if (args)
+warning (OPT_Wattributes, "%qE attribute arguments ignored", name);
You don't need this
On Wed, Sep 4, 2024 at 8:18 AM Jason Merrill wrote:
>
> Tested x86_64-pc-linux-gnu. Any objections?
>
> -- 8< --
>
> Several PRs complain about -Wswitch warning about a case for a bitwise
> combination of enumerators. Clang has an attribute flag_enum to prevent
> this; let's adopt that approach
On Wed, Sep 04, 2024 at 08:15:25AM -0400, Jason Merrill wrote:
> Tested x86_64-pc-linux-gnu. Any objections?
Looks good except...
> +/* Attributes also recognized in the clang:: namespace. */
> +const struct attribute_spec c_common_clang_attributes[] = {
> + { "flag_enum", 0, 0, fal
Tested x86_64-pc-linux-gnu. Any objections?
-- 8< --
Several PRs complain about -Wswitch warning about a case for a bitwise
combination of enumerators. Clang has an attribute flag_enum to prevent
this; let's adopt that approach as well.
This also recognizes the attribute as [[clang::flag_enum]