From 1ddca3f365df483715090940d330f02da42c0f2a Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Mon, 16 Jan 2017 15:43:06 +0000 Subject: [PATCH] revert: re PR c++/71737 (ICE following 2x pack expansion in non-pack with template alias) /c-family 2017-01-16 Paolo Carlini Revert: 2017-01-16 Paolo Carlini PR c++/71737 * c-common.c (set_underlying_type): Always set DECL_ORIGINAL_TYPE. /testsuite 2017-01-16 Paolo Carlini Revert: 2017-01-16 Paolo Carlini PR c++/71737 * g++.dg/cpp0x/pr71737.C: New. From-SVN: r244496 --- gcc/c-family/ChangeLog | 8 ++++++++ gcc/c-family/c-common.c | 16 +++++++--------- gcc/testsuite/ChangeLog | 8 ++++++++ gcc/testsuite/g++.dg/cpp0x/pr71737.C | 13 ------------- 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 525a73f93aa..de958748882 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,11 @@ +2017-01-16 Paolo Carlini + + Revert: + 2017-01-16 Paolo Carlini + + PR c++/71737 + * c-common.c (set_underlying_type): Always set DECL_ORIGINAL_TYPE. + 2017-01-16 Paolo Carlini PR c++/71737 diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 085bea03ac4..15ead18d36d 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -7419,18 +7419,16 @@ set_underlying_type (tree x) if (TYPE_NAME (TREE_TYPE (x)) == 0) TYPE_NAME (TREE_TYPE (x)) = x; } - else if (DECL_ORIGINAL_TYPE (x) == NULL_TREE) + else if (TREE_TYPE (x) != error_mark_node + && DECL_ORIGINAL_TYPE (x) == NULL_TREE) { tree tt = TREE_TYPE (x); DECL_ORIGINAL_TYPE (x) = tt; - if (tt != error_mark_node) - { - tt = build_variant_type_copy (tt); - TYPE_STUB_DECL (tt) = TYPE_STUB_DECL (DECL_ORIGINAL_TYPE (x)); - TYPE_NAME (tt) = x; - TREE_USED (tt) = TREE_USED (x); - TREE_TYPE (x) = tt; - } + tt = build_variant_type_copy (tt); + TYPE_STUB_DECL (tt) = TYPE_STUB_DECL (DECL_ORIGINAL_TYPE (x)); + TYPE_NAME (tt) = x; + TREE_USED (tt) = TREE_USED (x); + TREE_TYPE (x) = tt; } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e5fa65af9b8..f25ba45e2da 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2017-01-16 Paolo Carlini + + Revert: + 2017-01-16 Paolo Carlini + + PR c++/71737 + * g++.dg/cpp0x/pr71737.C: New. + 2017-01-16 Bill Schmidt * gcc.target/powerpc/swaps-p8-27.c: New. diff --git a/gcc/testsuite/g++.dg/cpp0x/pr71737.C b/gcc/testsuite/g++.dg/cpp0x/pr71737.C index 384d9478452..e69de29bb2d 100644 --- a/gcc/testsuite/g++.dg/cpp0x/pr71737.C +++ b/gcc/testsuite/g++.dg/cpp0x/pr71737.C @@ -1,13 +0,0 @@ -// PR c++/78765 -// { dg-do compile { target c++11 } } - -template