Commit 0d9cdbdd by Jason Merrill Committed by Jason Merrill

re PR c++/70627 (internal compiler error: verify_type failed)

	PR c++/70627

	* decl.c (start_enum): Don't change an existing ENUM_UNDERLYING_TYPE.

From-SVN: r234956
parent 85115fb6
2016-04-13 Jason Merrill <jason@redhat.com>
PR c++/70627
* decl.c (start_enum): Don't change an existing ENUM_UNDERLYING_TYPE.
2016-04-13 Paolo Carlini <paolo.carlini@oracle.com> 2016-04-13 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/70635 PR c++/70635
......
...@@ -13253,7 +13253,10 @@ start_enum (tree name, tree enumtype, tree underlying_type, ...@@ -13253,7 +13253,10 @@ start_enum (tree name, tree enumtype, tree underlying_type,
if (underlying_type) if (underlying_type)
{ {
if (CP_INTEGRAL_TYPE_P (underlying_type)) if (ENUM_UNDERLYING_TYPE (enumtype))
/* We already checked that it matches, don't change it to a different
typedef variant. */;
else if (CP_INTEGRAL_TYPE_P (underlying_type))
{ {
copy_type_enum (enumtype, underlying_type); copy_type_enum (enumtype, underlying_type);
ENUM_UNDERLYING_TYPE (enumtype) = underlying_type; ENUM_UNDERLYING_TYPE (enumtype) = underlying_type;
......
// PR c++/70627
// { dg-do compile { target c++11 } }
struct D;
struct A
{
D *operator->();
};
struct B
{
template <typename... T> void foo (T &&...) {}
};
typedef unsigned char G;
enum class H : G;
struct C
{
};
struct D : C
{
B foo () const { B a; a.foo (d); }
H d;
};
struct F : C
{
void foo ();
A f;
};
enum class H : unsigned char;
void F::foo () { B b = f->foo (); }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment