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 (OPT_Wattributes, "%qE attribute arguments ignored", name);
You don't need this check I think; if the # of args isn't correct, we
should not get here.  Then the goto can...go too.

Dropped.

On 9/4/24 11:28 AM, Eric Gallager wrote:

Question about PR tagging: should PR c++/81665 be tagged here, too?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81665

Added.

Here's what I'm pushing:


diff --git a/libstdc++-v3/include/bits/regex_constants.h b/libstdc++-v3/include/bits/regex_constants.h
index 437895f1dc3..4148093bc4e 100644
--- a/libstdc++-v3/include/bits/regex_constants.h
+++ b/libstdc++-v3/include/bits/regex_constants.h
@@ -66,7 +66,7 @@ namespace regex_constants
   * elements @c ECMAScript, @c basic, @c extended, @c awk, @c grep, @c egrep
   * %set.
   */
-  enum syntax_option_type : unsigned int
+  enum [[gnu::flag_enum]] syntax_option_type : unsigned int

This needs to be [[__gnu__::__flag_enum__]] because valid programs can
#define gnu 1
#define flag_enum 1

Oops, fixed:


From e4b64bea337d9ac936c555154f9d60c4876b65d3 Mon Sep 17 00:00:00 2001
From: Jason Merrill <ja...@redhat.com>
Date: Fri, 6 Sep 2024 12:12:24 -0400
Subject: [PATCH] libstdc++: add missing __
To: gcc-patches@gcc.gnu.org

I forgot the __ in my recent r15-3500-g1914ca8791ce4e.

libstdc++-v3/ChangeLog:

	* include/bits/regex_constants.h: Add __ to attribute.
---
 libstdc++-v3/include/bits/regex_constants.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libstdc++-v3/include/bits/regex_constants.h b/libstdc++-v3/include/bits/regex_constants.h
index 4148093bc4e..cb70a8647d9 100644
--- a/libstdc++-v3/include/bits/regex_constants.h
+++ b/libstdc++-v3/include/bits/regex_constants.h
@@ -66,7 +66,7 @@ namespace regex_constants
    * elements @c ECMAScript, @c basic, @c extended, @c awk, @c grep, @c egrep
    * %set.
    */
-  enum [[gnu::flag_enum]] syntax_option_type : unsigned int
+  enum [[__gnu__::__flag_enum__]] syntax_option_type : unsigned int
   {
     _S_icase		= 1 << 0,
     _S_nosubs		= 1 << 1,
-- 
2.46.0

Reply via email to