aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Carlini <paolo@gcc.gnu.org>2017-02-10 13:14:05 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2017-02-10 13:14:05 +0000
commita7c8ed0c361b549da67f9b83f91725fe1c84dbdb (patch)
tree0981afe6bf6346045f48609fbf0d7d2609d09d80
parent3dcde5efcd2ead7eee8864a46e1cc0e1fa459318 (diff)
downloadgcc-a7c8ed0c361b549da67f9b83f91725fe1c84dbdb.zip
gcc-a7c8ed0c361b549da67f9b83f91725fe1c84dbdb.tar.gz
gcc-a7c8ed0c361b549da67f9b83f91725fe1c84dbdb.tar.bz2
re PR c++/71737 (ICE following 2x pack expansion in non-pack with template alias)
/cp 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com> PR c++/71737 * pt.c (tsubst_decl): Don't try to preserve a typedef that names an error_mark_node as type. /testsuite 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com> PR c++/71737 * g++.dg/cpp0x/pr71737.C: New. From-SVN: r245327
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/pt.c4
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr71737.C13
4 files changed, 27 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index f615f90..0c5d165 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/71737
+ * pt.c (tsubst_decl): Don't try to preserve a typedef that names
+ an error_mark_node as type.
+
2017-02-09 Jakub Jelinek <jakub@redhat.com>
Jason Merrill <jason@redhat.com>
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 0a4510c..c23c14c 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -12877,11 +12877,11 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
args, complain, in_decl);
/* Preserve a typedef that names a type. */
- if (is_typedef_decl (r))
+ if (is_typedef_decl (r) && type != error_mark_node)
{
DECL_ORIGINAL_TYPE (r) = NULL_TREE;
set_underlying_type (r);
- if (TYPE_DECL_ALIAS_P (r) && type != error_mark_node)
+ if (TYPE_DECL_ALIAS_P (r))
/* An alias template specialization can be dependent
even if its underlying type is not. */
TYPE_DEPENDENT_P_VALID (TREE_TYPE (r)) = false;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3cf1cb2..050bd52 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
+2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/71737
+ * g++.dg/cpp0x/pr71737.C: New.
+
2017-02-10 Prasad Ghangal <prasad.ghangal@gmail.com>
- Richard Biener <rguenther@suse.de>
+ Richard Biener <rguenther@suse.de>
* gcc.dg/gimplefe-error-1.c: New testcase.
* gcc.dg/gimplefe-error-2.c: New testcase.
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr71737.C b/gcc/testsuite/g++.dg/cpp0x/pr71737.C
index e69de29..384d947 100644
--- a/gcc/testsuite/g++.dg/cpp0x/pr71737.C
+++ 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>;