Tested x86_64-pc-linux-gnu, applying to trunk.

-- 8< --

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.
---
 gcc/cp/name-lookup.h | 4 ++++
 1 file changed, 4 insertions(+)

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),

base-commit: a8c03f056f4070a618bc59afcae2290cf21456ea
-- 
2.49.0

Reply via email to