+2014-06-11 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/60265
+ * parser.c (cp_parser_using_declaration): Handle unscoped enums.
+ * name-lookup.c (validate_nonmember_using_decl): Adjust error
+ message.
+
2014-06-11 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/19200
member-declaration. */
if (TYPE_P (scope))
{
- error ("%qT is not a namespace", scope);
+ error ("%qT is not a namespace or unscoped enum", scope);
return NULL_TREE;
}
else if (scope == error_mark_node)
/*is_declaration=*/true);
if (!qscope)
qscope = global_namespace;
+ else if (UNSCOPED_ENUM_P (qscope))
+ qscope = CP_TYPE_CONTEXT (qscope);
if (access_declaration_p && cp_parser_error_occurred (parser))
/* Something has already gone wrong; there's no need to parse
+2014-06-11 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/60265
+ * g++.dg/cpp0x/using-enum-1.C: New.
+ * g++.dg/cpp0x/using-enum-2.C: Likewise.
+
2014-06-11 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/19200
--- /dev/null
+// PR c++/60265
+// { dg-do compile { target c++11 } }
+
+namespace A
+{
+ enum E { V };
+
+ using E::V;
+}
+
+void foo()
+{
+ using A::E::V;
+}
+
+using A::E::V;
+
+enum F { U };
+
+using F::U;
--- /dev/null
+// PR c++/60265
+// { dg-do compile { target c++11 } }
+
+namespace A
+{
+ enum class E { V };
+
+ using E::V; // { dg-error "not a namespace or unscoped enum" }
+}
+
+void foo()
+{
+ using A::E::V; // { dg-error "not a namespace or unscoped enum" }
+}
+
+using A::E::V; // { dg-error "not a namespace or unscoped enum" }
+
+enum class F { U };
+
+using F::U; // { dg-error "not a namespace or unscoped enum" }