re PR c++/54859 (constexpr in template alias rejected as non-constant)
authorJason Merrill <jason@redhat.com>
Fri, 9 Nov 2012 16:14:48 +0000 (11:14 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 9 Nov 2012 16:14:48 +0000 (11:14 -0500)
PR c++/54859
* pt.c (check_instantiated_arg): Don't complain about dependent args.

From-SVN: r193368

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/alias-decl-25.C [new file with mode: 0644]

index 4d6d954db1f70f4fb7bdb8155e9c3b426d71aae4..59167be0e23bf702304631e545c1fc5bc0b988d1 100644 (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.
index 1ff1c73b90d7e9943856db88fde5d85106a3c4d8..50d12b08348c4b4dbcdfd8274b4224051aae9664 100644 (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);
index 608e017943c6c6ca875caf8e2650def39a0709f5..e888313413898a2708b6a9d8f93ee4b682642d4b 100644 (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.
 
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 (file)
index 0000000..e72bd35
--- /dev/null
@@ -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;