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
This commit is contained in:
Jason Merrill 2012-11-09 11:14:48 -05:00 committed by Jason Merrill
parent 7dbb85a793
commit 2a28e76a78
4 changed files with 18 additions and 0 deletions

View File

@ -1,5 +1,8 @@
2012-11-09 Jason Merrill <jason@redhat.com>
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.

View File

@ -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);

View File

@ -1,5 +1,8 @@
2012-11-09 Jason Merrill <jason@redhat.com>
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.

View File

@ -0,0 +1,10 @@
// PR c++/54859
// { dg-options -std=c++11 }
template<unsigned N>
using Num = int;
template<typename... Types>
using Count = Num<sizeof...(Types)>;
Count<int, char, void> i;