PR c++/79657
* semantics.c (finish_underlying_type): Bail out for incomplete enums.
* g++.dg/ext/underlying_type12.C: New test.
From-SVN: r245658
* pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
error_mark_node.
+ PR c++/79657
+ * semantics.c (finish_underlying_type): Bail out for incomplete enums.
+
2017-02-21 Jason Merrill <jason@redhat.com>
PR c++/50308 - wrong deprecated warning with ADL
return underlying_type;
}
- complete_type (type);
+ if (!complete_type_or_else (type, NULL_TREE))
+ return error_mark_node;
if (TREE_CODE (type) != ENUMERAL_TYPE)
{
* g++.dg/cpp0x/alignas10.C: New test.
* g++.dg/cpp0x/alignas9.C: New test.
+ PR c++/79657
+ * g++.dg/ext/underlying_type12.C: New test.
+
2017-02-22 Jakub Jelinek <jakub@redhat.com>
PR target/70465
--- /dev/null
+// PR c++/79657
+// { dg-do compile { target c++11 } }
+
+enum A { x };
+enum B { a = (__underlying_type (A)) 1 };
+enum C { b = (__underlying_type (C)) 1 }; // { dg-error "incomplete" }