From: Jason Merrill Date: Sat, 24 May 2025 18:41:43 +0000 (-0400) Subject: c++: add operator| for WMB_Flags X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c18f152447c0ae1ac752d8a14b582d099a329c0c;p=thirdparty%2Fgcc.git c++: add operator| for WMB_Flags There are a lot of uses of | on WMB_Flags, that currently need to then be cast back to WMB_Flags. Let's avoid the need for that. gcc/cp/ChangeLog: * name-lookup.h (operator|, operator|=): Define for WMB_Flags. --- diff --git a/gcc/cp/name-lookup.h b/gcc/cp/name-lookup.h index 4216a515afa..2fa736bd046 100644 --- a/gcc/cp/name-lookup.h +++ b/gcc/cp/name-lookup.h @@ -501,6 +501,10 @@ enum WMB_Flags WMB_Hidden = 1 << 3, WMB_Purview = 1 << 4, }; +inline WMB_Flags operator|(WMB_Flags x, WMB_Flags y) +{ return WMB_Flags(+x|y); } +inline WMB_Flags& operator|=(WMB_Flags& x, WMB_Flags y) +{ return x = x|y; } extern unsigned walk_module_binding (tree binding, bitmap partitions, bool (*)(tree decl, WMB_Flags, void *data),