From 2a28e76a78ec4f3bb1219c4ba5795f86dccb43cd Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Fri, 9 Nov 2012 11:14:48 -0500 Subject: [PATCH] re PR c++/54859 (constexpr in template alias rejected as non-constant) PR c++/54859 * pt.c (check_instantiated_arg): Don't complain about dependent args. From-SVN: r193368 --- gcc/cp/ChangeLog | 3 +++ gcc/cp/pt.c | 2 ++ gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/g++.dg/cpp0x/alias-decl-25.C | 10 ++++++++++ 4 files changed, 18 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/alias-decl-25.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4d6d954db1f..59167be0e23 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2012-11-09 Jason Merrill + PR c++/54859 + * pt.c (check_instantiated_arg): Don't complain about dependent args. + * tree.c (cxx_attribute_table): Add abi_tag attribute. (check_abi_tag_redeclaration, handle_abi_tag_attribute): New. * class.c (find_abi_tags_r, check_abi_tags): New. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 1ff1c73b90d..50d12b08348 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -14362,6 +14362,8 @@ tsubst_copy_and_build (tree t, static bool check_instantiated_arg (tree tmpl, tree t, tsubst_flags_t complain) { + if (dependent_template_arg_p (t)) + return false; if (ARGUMENT_PACK_P (t)) { tree vec = ARGUMENT_PACK_ARGS (t); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 608e017943c..e8883134138 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2012-11-09 Jason Merrill + PR c++/54859 + * g++.dg/cpp0x/alias-decl-25.C: New. + * g++.dg/abi/abi-tag1.C: New. * g++.dg/abi/abi-tag2.C: New. diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-25.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-25.C new file mode 100644 index 00000000000..e72bd350912 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-25.C @@ -0,0 +1,10 @@ +// PR c++/54859 +// { dg-options -std=c++11 } + +template + using Num = int; + +template + using Count = Num; + +Count i;