]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/27582 (ICE with invalid template parameter)
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Mon, 15 May 2006 09:40:30 +0000 (09:40 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Mon, 15 May 2006 09:40:30 +0000 (09:40 +0000)
PR c++/27582
* pt.c (any_dependent_template_arguments_p): Return early on invalid
argument list.

* g++.dg/template/dependent-args1.C: New test.

From-SVN: r113786

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/dependent-args1.C [new file with mode: 0644]

index 2773248686a70e25748985d79ff4ddd6c7863e0b..5c07ea6916b3bf7335ce904114c1a1503c97487b 100644 (file)
@@ -1,5 +1,9 @@
 2006-05-15  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
+       PR c++/27582
+       * pt.c (any_dependent_template_arguments_p): Return early on invalid
+       argument list.
+
        PR c++/27581
        * search.c (adjust_result_of_qualified_name_lookup): Skip on
        invalid context_class.
index 26c63d81759b93ebe4d1842ca26200d4b5269614..0b7f2e67c6b5be7515f2b3aab53ea2a135a4845a 100644 (file)
@@ -12561,6 +12561,8 @@ any_dependent_template_arguments_p (tree args)
 
   if (!args)
     return false;
+  if (args == error_mark_node)
+    return true;
 
   for (i = 0; i < TMPL_ARGS_DEPTH (args); ++i)
     {
index b720772ea5ac73a22b0761187197674e327afc09..5883d5525dbc160991b7f0928778e1c69d6244cf 100644 (file)
@@ -1,5 +1,8 @@
 2006-05-15  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
+       PR c++/27582
+       * g++.dg/template/dependent-args1.C: New test.
+
        PR c++/27581
        * g++.dg/lookup/this1.C: New test.
 
diff --git a/gcc/testsuite/g++.dg/template/dependent-args1.C b/gcc/testsuite/g++.dg/template/dependent-args1.C
new file mode 100644 (file)
index 0000000..0b197cf
--- /dev/null
@@ -0,0 +1,11 @@
+// PR c++/27582
+// { dg-do compile }
+
+struct A
+{
+  template<int> void foo();
+};
+
+template<int N, void (A::*)() = &A::foo<N> > struct B {};
+
+B<int> b; // { dg-error "type/value mismatch|expected a constant|invalid type" }