From: Jason Merrill Date: Fri, 21 Nov 2014 21:34:54 +0000 (-0500) Subject: re PR c++/63588 (ICE (segfault) on arm-linux-gnueabihf) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=169fe7fa43bd721a26b59707b931e5799ead4e6a;p=gcc.git re PR c++/63588 (ICE (segfault) on arm-linux-gnueabihf) PR c++/63588 * pt.c (uses_template_parms): Handle null argument. From-SVN: r217948 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 033ce7b7499..89d4ade46f9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2014-11-21 Jason Merrill + + PR c++/63588 + * pt.c (uses_template_parms): Handle null argument. + 2014-11-21 Jakub Jelinek PR target/63764 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 71b7af1c206..1d6b916c003 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -8294,6 +8294,9 @@ for_each_template_parm (tree t, tree_fn_t fn, void* data, int uses_template_parms (tree t) { + if (t == NULL_TREE) + return false; + bool dependent_p; int saved_processing_template_decl; diff --git a/gcc/testsuite/g++.dg/cpp1y/var-templ15.C b/gcc/testsuite/g++.dg/cpp1y/var-templ15.C new file mode 100644 index 00000000000..7dd2dcdcf94 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/var-templ15.C @@ -0,0 +1,5 @@ +// PR c++/63588 +// { dg-do compile { target c++14 } } + +template T elements; +int i = elements <>; // { dg-error "arguments" }