revert: re PR c++/71737 (ICE following 2x pack expansion in non-pack with template...
authorPaolo Carlini <paolo.carlini@oracle.com>
Mon, 16 Jan 2017 15:43:06 +0000 (15:43 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 16 Jan 2017 15:43:06 +0000 (15:43 +0000)
/c-family
2017-01-16  Paolo Carlini  <paolo.carlini@oracle.com>

Revert:
      2017-01-16  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/71737
* c-common.c (set_underlying_type): Always set DECL_ORIGINAL_TYPE.

/testsuite
2017-01-16  Paolo Carlini  <paolo.carlini@oracle.com>

Revert:
        2017-01-16  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/71737
* g++.dg/cpp0x/pr71737.C: New.

From-SVN: r244496

gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/pr71737.C

index 525a73f93aad7b235c98ca5233a3d18dcb92ed8d..de95874888284073c2cef3f3ea53aaace7dd8f10 100644 (file)
@@ -1,3 +1,11 @@
+2017-01-16  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       Revert:
+       2017-01-16  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/71737
+       * c-common.c (set_underlying_type): Always set DECL_ORIGINAL_TYPE.
+
 2017-01-16  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/71737
index 085bea03ac4bdf204ccf8f1c78b95fabb4bc3352..15ead18d36dca5ca7f3cbc4bb2cf75e9ca0dd42c 100644 (file)
@@ -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;
     }
 }
 
index e5fa65af9b841b48c568d2eb130b084ac0b93ad8..f25ba45e2dab08a698bc0d0dec7ecad05f58f06c 100644 (file)
@@ -1,3 +1,11 @@
+2017-01-16  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       Revert:
+        2017-01-16  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/71737
+       * g++.dg/cpp0x/pr71737.C: New.
+
 2017-01-16  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
        * gcc.target/powerpc/swaps-p8-27.c: New.
index 384d947845286565ce603f3d2ad1c7c228927fdb..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,13 +0,0 @@
-// PR c++/78765
-// { dg-do compile { target c++11 } }
-
-template <template <typename ...> class TT>
-struct quote {
-  template <typename ...Ts>
-  using apply = TT<Ts...>;  // { dg-error "pack expansion" }
-};
-
-template <typename>
-using to_int_t = int;
-
-using t = quote<quote<to_int_t>::apply>::apply<int>;