]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/36411 (ICE with invalid template template parameter)
authorH.J. Lu <hongjiu.lu@intel.com>
Mon, 23 Feb 2009 22:34:50 +0000 (22:34 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Mon, 23 Feb 2009 22:34:50 +0000 (14:34 -0800)
gcc/cp

2009-02-23  H.J. Lu  <hongjiu.lu@intel.com>

PR c++/36411
* pt.c (coerce_template_template_parms): Return 0 if parameter
is error_mark_node.

gcc/testsuite/

2009-02-23  H.J. Lu  <hongjiu.lu@intel.com>

PR c++/36411
* g++.dg/template/void14.C: New.

From-SVN: r144396

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

index d2b2dbea0a6c19e665a2ccc7848b0fd4345b5cab..0af13722a56c8663aa9c346c28b9beafc27bfc2e 100644 (file)
@@ -1,3 +1,9 @@
+2009-02-23  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR c++/36411
+       * pt.c (coerce_template_template_parms): Return 0 if parameter
+       is error_mark_node.
+
 2009-02-23  Jason Merrill  <jason@redhat.com>
 
        * pt.c (unify): Call maybe_adjust_types_for_deduction when
index 7246b13c3d6ab498b0edd54c1302cb3fe984b061..bef6002c4ff6aeca20c989d6cdbcf3ed1207ee6f 100644 (file)
@@ -4756,6 +4756,9 @@ coerce_template_template_parms (tree parm_parms,
     {
       parm = TREE_VALUE (TREE_VEC_ELT (parm_parms, nparms - 1));
       
+      if (parm == error_mark_node)
+       return 0;
+
       switch (TREE_CODE (parm))
         {
         case TEMPLATE_DECL:
index 9c6b43aec27ad321410890c4a024b851018ea331..ac5bf2ec57d07ff94d8a12a138f415ec6e5d88c7 100644 (file)
@@ -1,3 +1,8 @@
+2009-02-23  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR c++/36411
+       * g++.dg/template/void14.C: New.
+
 2009-02-23  Jason Merrill  <jason@redhat.com>
 
        PR c++/38880
diff --git a/gcc/testsuite/g++.dg/template/void14.C b/gcc/testsuite/g++.dg/template/void14.C
new file mode 100644 (file)
index 0000000..7781c61
--- /dev/null
@@ -0,0 +1,7 @@
+// PR c++/36411
+// { dg-do compile }
+
+template<template<void> class> struct A // { dg-error "not a valid type" }
+{
+  template<template<int> class T> A<T> foo(); // { dg-error "mismatch|expected|invalid" }
+};