From 783f0cfc8d973c147a5243d7312b85e7ea892e1c Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Tue, 17 Sep 2013 17:46:03 +0000 Subject: [PATCH] re PR c++/58435 (Applying a type transformation to a list: const ignored) /cp 2013-09-17 Paolo Carlini PR c++/58435 * pt.c (tsubst, [BOUND_TEMPLATE_TEMPLATE_PARM]): Take into account the cp_type_quals (r) too. /testsuite 2013-09-17 Paolo Carlini PR c++/58435 * g++.dg/cpp0x/alias-decl-38.C: New. From-SVN: r202662 --- gcc/cp/ChangeLog | 9 ++++- gcc/cp/pt.c | 2 +- gcc/testsuite/ChangeLog | 6 ++++ gcc/testsuite/g++.dg/cpp0x/alias-decl-38.C | 41 ++++++++++++++++++++++ 4 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp0x/alias-decl-38.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5fbc78c1c2a..7e2c13beb5e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2013-09-17 Paolo Carlini + + PR c++/58435 + * pt.c (tsubst, [BOUND_TEMPLATE_TEMPLATE_PARM]): Take into account + the cp_type_quals (r) too. + 2013-09-16 Adam Butcher * cp-tree.h (type_uses_auto_or_concept): Declare. @@ -11,7 +17,8 @@ (is_auto_or_concept): New function. (type_uses_auto_or_concept): New function. * parser.h (struct cp_parser): Add fully_implicit_function_template_p. - * parser.c (cp_parser_new): Initialize fully_implicit_function_template_p. + * parser.c (cp_parser_new): Initialize + fully_implicit_function_template_p. (cp_parser_new): Initialize fully_implicit_function_template_p. (cp_parser_lambda_expression): Copy and restore value of fully_implicit_function_template_p as per other parser fields. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index c2e251aaf85..e0b71108fcf 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -11540,7 +11540,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl) /*entering_scope=*/0, complain); return cp_build_qualified_type_real - (r, cp_type_quals (t), complain); + (r, cp_type_quals (t) | cp_type_quals (r), complain); } else /* TEMPLATE_TEMPLATE_PARM or TEMPLATE_PARM_INDEX. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b36c03355cd..205dee8b01f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2013-09-17 Paolo Carlini + + PR c++/58435 + * pt.c (tsubst, [BOUND_TEMPLATE_TEMPLATE_PARM]): Take into account + the cp_type_quals (r) too. + 2013-09-17 Jan Hubicka PR middle-end/58332 diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-38.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-38.C new file mode 100644 index 00000000000..bc98737b849 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-38.C @@ -0,0 +1,41 @@ +// PR c++/58435 +// { dg-do compile { target c++11 } } + +template +struct same { static const bool value = false; }; +template +struct same { static const bool value = true; }; + +template