From 6602e1095db5259590fa8813f48a1404ba00cf10 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Fri, 21 Nov 2014 16:35:00 -0500 Subject: [PATCH] re PR c++/63849 ([c++11] ICE on variadic alias template with wrappers) PR c++/63849 * mangle.c (decl_mangling_context): Use template_type_parameter_p. From-SVN: r217949 --- gcc/cp/ChangeLog | 3 ++ gcc/cp/mangle.c | 3 +- gcc/testsuite/g++.dg/cpp0x/alias-decl-44.C | 43 ++++++++++++++++++++++ 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp0x/alias-decl-44.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 89d4ade46f9..652ec9ca63e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2014-11-21 Jason Merrill + PR c++/63849 + * mangle.c (decl_mangling_context): Use template_type_parameter_p. + PR c++/63588 * pt.c (uses_template_parms): Handle null argument. diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 4c63df042fa..9f0d9d8ed77 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -764,8 +764,7 @@ decl_mangling_context (tree decl) if (extra) return extra; } - else if (TREE_CODE (decl) == TYPE_DECL - && TREE_CODE (TREE_TYPE (decl)) == TEMPLATE_TYPE_PARM) + else if (template_type_parameter_p (decl)) /* template type parms have no mangling context. */ return NULL_TREE; return CP_DECL_CONTEXT (decl); diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-44.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-44.C new file mode 100644 index 00000000000..bd20b54f142 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-44.C @@ -0,0 +1,43 @@ +// PR c++/63849 +// { dg-do compile { target c++11 } } + +template +using First = _T; // we should not use this + // alias with only + // one pack parameter (?) + +template