From: Marek Polacek Date: Mon, 26 Feb 2018 14:12:25 +0000 (+0000) Subject: re PR c++/84537 (ICE in get_string, at spellcheck-tree.h) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7518398dce1d913e01899d3aa52caec50e6efb4f;p=gcc.git re PR c++/84537 (ICE in get_string, at spellcheck-tree.h) PR c++/84537 * name-lookup.c (suggest_alternative_in_explicit_scope): Return false if name is error node. * g++.dg/parse/error60.C: New test. From-SVN: r257988 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index cb0dcd7c43e..d824175aafc 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2018-02-26 Marek Polacek + + PR c++/84537 + * name-lookup.c (suggest_alternative_in_explicit_scope): Return false + if name is error node. + 2018-02-25 Jason Merrill PR c++/84015 - ICE with class deduction and auto template parm. diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 9117e0b30eb..0f00328e96e 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -5541,6 +5541,10 @@ bool suggest_alternative_in_explicit_scope (location_t location, tree name, tree scope) { + /* Something went very wrong; don't suggest anything. */ + if (name == error_mark_node) + return false; + /* Resolve any namespace aliases. */ scope = ORIGINAL_NAMESPACE (scope); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ba3101dd634..8c16b19f04a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-02-26 Marek Polacek + + PR c++/84537 + * g++.dg/parse/error60.C: New test. + 2018-02-26 Jakub Jelinek PR c++/84556 diff --git a/gcc/testsuite/g++.dg/parse/error60.C b/gcc/testsuite/g++.dg/parse/error60.C new file mode 100644 index 00000000000..38f4e34c59d --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/error60.C @@ -0,0 +1,9 @@ +// PR c++/84537 +// { dg-do compile } + +namespace N +{ + template struct A {}; +} + +N::template A<> a; // { dg-error "" }