Commit a7c8ed0c by Paolo Carlini

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
parent 3dcde5ef
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> 2017-02-09 Jakub Jelinek <jakub@redhat.com>
Jason Merrill <jason@redhat.com> Jason Merrill <jason@redhat.com>
......
...@@ -12877,11 +12877,11 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain) ...@@ -12877,11 +12877,11 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
args, complain, in_decl); args, complain, in_decl);
/* Preserve a typedef that names a type. */ /* 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; DECL_ORIGINAL_TYPE (r) = NULL_TREE;
set_underlying_type (r); 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 /* An alias template specialization can be dependent
even if its underlying type is not. */ even if its underlying type is not. */
TYPE_DEPENDENT_P_VALID (TREE_TYPE (r)) = false; TYPE_DEPENDENT_P_VALID (TREE_TYPE (r)) = false;
......
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> 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-1.c: New testcase.
* gcc.dg/gimplefe-error-2.c: New testcase. * gcc.dg/gimplefe-error-2.c: New testcase.
......
// 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>;
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