* decl.c (start_enum): Avoid using ENUM_UNDERLYING_TYPE on a
non-enum.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182441
138bc75d-0d04-0410-961f-
82ee72b054a4
+2011-12-17 Jason Merrill <jason@redhat.com>
+
+ PR c++/51587
+ * decl.c (start_enum): Avoid using ENUM_UNDERLYING_TYPE on a
+ non-enum.
+
2011-12-16 Jason Merrill <jason@redhat.com>
PR c++/51416
/* Do not push the decl more than once, unless we need to
compare underlying types at instantiation time */
if (!enumtype
+ || TREE_CODE (enumtype) != ENUMERAL_TYPE
|| (underlying_type
&& dependent_type_p (underlying_type))
|| (ENUM_UNDERLYING_TYPE (enumtype)
+2011-12-17 Jason Merrill <jason@redhat.com>
+
+ PR c++/51587
+ * g++.dg/parse/enum6.C: New.
+
2011-12-17 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/51491
--- /dev/null
+// PR c++/51587
+
+namespace N
+{
+ struct X; // { dg-message "previous declaration" }
+}
+
+enum N::X {}; // { dg-error "conflicting declaration" }