+2013-05-08 Jason Merrill <jason@redhat.com>
+
+ PR c++/57068
+ * decl.c (grokdeclarator): Warn about ref-qualifiers here.
+ * parser.c (cp_parser_ref_qualifier_seq_opt): Not here.
+ * error.c (maybe_warn_cpp0x): s/0x/11/.
+
2013-05-08 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51226
if (rqual)
{
+ maybe_warn_cpp0x (CPP0X_REF_QUALIFIER);
error ((flags == DTOR_FLAG)
? "destructors may not be ref-qualified"
: "constructors may not be ref-qualified");
break;
case CPP0X_AUTO:
pedwarn (input_location, 0,
- "C++0x auto only available with -std=c++11 or -std=gnu++11");
+ "C++11 auto only available with -std=c++11 or -std=gnu++11");
break;
case CPP0X_SCOPED_ENUMS:
pedwarn (input_location, 0,
case CPP0X_REF_QUALIFIER:
pedwarn (input_location, 0,
"ref-qualifiers "
- "only available with -std=c++0x or -std=gnu++0x");
+ "only available with -std=c++11 or -std=gnu++11");
break;
default:
gcc_unreachable ();
}
}
- if (ref_qual)
- maybe_warn_cpp0x (CPP0X_REF_QUALIFIER);
-
return ref_qual;
}
--- /dev/null
+// PR c++/57068
+
+enum Enums {
+ Enum1 = 0x00000000,
+ Enum2 = 0x00000001
+};
+
+class Flags {
+public:
+ Flags() : i(0) {}
+ Flags(int i): i(i) {}
+ Flags operator&(Enums f) { return Flags(Enums(i & f)); }
+
+ operator bool() { return i; }
+private:
+ int i;
+};
+
+Flags windowState()
+{
+ return Flags();
+}
+
+int main()
+{
+ if (bool(windowState() & Enum1) == true)
+ return 1;
+ return 0;
+}