From 4ac4b596988312f096f860d3e10579af438e3085 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Tue, 4 May 2010 14:17:52 +0000 Subject: [PATCH] re PR c++/43705 (ICE: SIGSEGV with template specialization in non-namespace scope) /cp 2010-05-04 Paolo Carlini PR c++/43705 * call.c (build_new_method_call): Return error_mark_node if fns is NULL_TREE. /testsuite 2010-05-04 Paolo Carlini PR c++/43705 * g++.dg/template/crash95.C: New. From-SVN: r159029 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/call.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/template/crash95.C | 11 +++++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/template/crash95.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 026abe8254d..634a74b9834 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2010-05-04 Paolo Carlini + + PR c++/43705 + * call.c (build_new_method_call): Return error_mark_node if fns is + NULL_TREE. + 2010-05-03 Dodji Seketeli PR c++/43953 diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 7915417bd6e..157b473cdc4 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -6219,7 +6219,7 @@ build_new_method_call (tree instance, tree fns, VEC(tree,gc) **args, *fn_p = NULL_TREE; if (error_operand_p (instance) - || error_operand_p (fns)) + || !fns || error_operand_p (fns)) return error_mark_node; if (!BASELINK_P (fns)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 29eaf717164..d43de64bde4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-05-04 Paolo Carlini + + PR c++/43705 + * g++.dg/template/crash95.C: New. + 2010-05-04 H.J. Lu PR debug/43508 diff --git a/gcc/testsuite/g++.dg/template/crash95.C b/gcc/testsuite/g++.dg/template/crash95.C new file mode 100644 index 00000000000..959a9d066ac --- /dev/null +++ b/gcc/testsuite/g++.dg/template/crash95.C @@ -0,0 +1,11 @@ +// PR c++/43705 + +template < typename > struct S +{ + template < > struct S < int > // { dg-error "explicit|specialization|template|parameter" } + { + S(int); + }; +}; + +S < int > s(0); -- 2.30.2