1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
// PR c++/14586 enum E { e }; E & operator |= (E &f1, const E &f2); E operator | (const E &f1, const E &f2) { E result = f1; result |= f2; return result; } template <typename> void foo () { const E flags = e | e; } template void foo<double> ();