From 4f0c72d921f7fb95a2d0a94e0cc0c0c1fb1dc926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kr=C3=BCgler?= Date: Sat, 21 Oct 2023 11:45:14 +0200 Subject: [PATCH] New issue from Jiang An: "Constants in std::regex_constants should be allowed to be enumerators" --- xml/issue3998.xml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 xml/issue3998.xml diff --git a/xml/issue3998.xml b/xml/issue3998.xml new file mode 100644 index 0000000000..c1bb8bd017 --- /dev/null +++ b/xml/issue3998.xml @@ -0,0 +1,32 @@ + + + + +Constants in <tt>std::regex_constants</tt> should be allowed to be enumerators +
+Jiang An +18 Oct 2023 +99 + + +

+Currently, MSVC STL and libc++ implement constants in std::regex_constants as +enumerators of unscoped enumerations, while the standard specify them to be constexpr variables. +

+Casey Carter argued +that it would be better to make these constants prvalues to avoid wasting space in object files. And +presumably almost all users just use their values without odr-using them or relying on their value category. +

+Perhaps we should allow these constants to be enumerators of the corresponding type (syntax_option_type, +match_flag_type, or error_type) if the corresponding type is an enumeration. +

+Notes: since C++20, we can even make the enumeration types scoped and expose the enumerators to the +namespace by using-declaration or using-enum-declaration. might be related, +since it changed former enumerators to constexpr variables. +

+
+ + + + +