aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2012-01-23 17:56:42 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2012-01-23 17:56:42 +0000
commit1beb527252452165fc7b441562f803c72fdc666a (patch)
tree2ae39565a21adbf939859c40d2a6093bf3b78e1c /gcc
parente617b554f875af03992ab03b45752bfdeb418730 (diff)
downloadgcc-1beb527252452165fc7b441562f803c72fdc666a.zip
gcc-1beb527252452165fc7b441562f803c72fdc666a.tar.gz
gcc-1beb527252452165fc7b441562f803c72fdc666a.tar.bz2
re PR c++/51398 (ICE with invalid template parameter)
/cp 2012-01-23 Paolo Carlini <paolo.carlini@oracle.com> PR c++/51398 * pt.c (parameter_of_template_p): Skip error_mark_node parameters. /testsuite 2012-01-23 Paolo Carlini <paolo.carlini@oracle.com> PR c++/51398 * g++.dg/template/crash111.C: New. From-SVN: r183445
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/pt.c3
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/template/crash111.C6
4 files changed, 19 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index b6bf88f..13f3484 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2012-01-23 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/51398
+ * pt.c (parameter_of_template_p): Skip error_mark_node parameters.
+
2012-01-23 Jason Merrill <jason@redhat.com>
PR c++/51925
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index a4460f1..e440be7 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -8157,6 +8157,9 @@ parameter_of_template_p (tree parm, tree templ)
for (i = 0; i < TREE_VEC_LENGTH (parms); ++i)
{
tree p = TREE_VALUE (TREE_VEC_ELT (parms, i));
+ if (p == error_mark_node)
+ continue;
+
if (parm == p
|| (DECL_INITIAL (parm)
&& DECL_INITIAL (parm) == DECL_INITIAL (p)))
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 41929df..37a5614 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2012-01-23 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/51398
+ * g++.dg/template/crash111.C: New.
+
2012-01-23 Arnaud Charlet <charlet@adacore.com>
* ada/acats/tests/cxh/cxh1001.a: Removed, test not suitable on all
diff --git a/gcc/testsuite/g++.dg/template/crash111.C b/gcc/testsuite/g++.dg/template/crash111.C
new file mode 100644
index 0000000..f711260
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/crash111.C
@@ -0,0 +1,6 @@
+// PR c++/51398
+
+template<void, int N> struct A // { dg-error "not a valid type" }
+{
+ static const int i = N;
+};