aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2017-01-16 09:09:30 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2017-01-16 09:09:30 +0000
commit7d2f3f1d2968d16c89b0c046d730ab57fa6875d4 (patch)
tree736e048357146c99ea7cf08124c6ce193a9ebca7 /gcc
parentd743728f903ea03b0114feb594e038ca8ca799d9 (diff)
downloadgcc-7d2f3f1d2968d16c89b0c046d730ab57fa6875d4.zip
gcc-7d2f3f1d2968d16c89b0c046d730ab57fa6875d4.tar.gz
gcc-7d2f3f1d2968d16c89b0c046d730ab57fa6875d4.tar.bz2
re PR c++/71737 (ICE following 2x pack expansion in non-pack with template alias)
/c-family 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> PR c++/71737 * g++.dg/cpp0x/pr71737.C: New. From-SVN: r244486
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-family/ChangeLog5
-rw-r--r--gcc/c-family/c-common.c16
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr71737.C13
4 files changed, 32 insertions, 7 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 774ca4e..525a73f 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,8 @@
+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-12 Martin Sebor <msebor@redhat.com>
(-Wformat-overflow): ...to this.
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 15ead18..085bea0 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -7419,16 +7419,18 @@ set_underlying_type (tree x)
if (TYPE_NAME (TREE_TYPE (x)) == 0)
TYPE_NAME (TREE_TYPE (x)) = x;
}
- else if (TREE_TYPE (x) != error_mark_node
- && DECL_ORIGINAL_TYPE (x) == NULL_TREE)
+ else if (DECL_ORIGINAL_TYPE (x) == NULL_TREE)
{
tree tt = TREE_TYPE (x);
DECL_ORIGINAL_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;
+ 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;
+ }
}
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 7e5731e..aeb050a 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2017-01-16 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/71737
+ * g++.dg/cpp0x/pr71737.C: New.
+
2017-01-16 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/opt62.adb: New test.
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr71737.C b/gcc/testsuite/g++.dg/cpp0x/pr71737.C
new file mode 100644
index 0000000..384d947
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/pr71737.C
@@ -0,0 +1,13 @@
+// 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>;