* semantics.c (finish_qualified_id_expr): Don't return an
unqualified IDENTIFIER_NODE.
From-SVN: r259805
+2018-05-01 Jason Merrill <jason@redhat.com>
+
+ PR c++/85587 - error with scoped enum in template.
+ * semantics.c (finish_qualified_id_expr): Don't return an
+ unqualified IDENTIFIER_NODE.
+
2018-04-30 Jason Merrill <jason@redhat.com>
PR c++/85580 - extern "C" and local variables
}
/* No need to check access within an enum. */
- if (TREE_CODE (qualifying_class) == ENUMERAL_TYPE)
+ if (TREE_CODE (qualifying_class) == ENUMERAL_TYPE
+ && TREE_CODE (expr) != IDENTIFIER_NODE)
return expr;
/* Within the scope of a class, turn references to non-static
--- /dev/null
+// PR c++/85587
+// { dg-do compile { target c++11 } }
+
+template <int N>
+struct S
+{
+ enum class T
+ {
+ E, F
+ };
+ void foo ();
+};
+
+template <int N>
+void S<N>::foo ()
+{
+ decltype (T::F) t;
+}
+
+void
+bar ()
+{
+ S<0> s;
+ s.foo ();
+}