From: Jakub Jelinek Date: Tue, 19 Feb 2019 08:38:54 +0000 (+0100) Subject: re PR c++/89390 (ICE in get_string, at spellcheck-tree.h:46) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=883c07964f42c00b66dbb81d2ec742e4ee23a3c2;p=gcc.git re PR c++/89390 (ICE in get_string, at spellcheck-tree.h:46) PR c++/89390 * error.c (qualified_name_lookup_error): Only call suggest_alternative_in_scoped_enum if name is IDENTIFIER_NODE. * g++.dg/diagnostic/pr89390.C: New test. From-SVN: r269007 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e2b9be50ff1..21979b564f8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2019-02-19 Jakub Jelinek + + PR c++/89390 + * error.c (qualified_name_lookup_error): Only call + suggest_alternative_in_scoped_enum if name is IDENTIFIER_NODE. + 2019-02-19 Tom Honermann * name-lookup.c (get_std_name_hint): Added u8string as a name hint. diff --git a/gcc/cp/error.c b/gcc/cp/error.c index f585d5fe58f..dd3a339a237 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -4276,7 +4276,7 @@ qualified_name_lookup_error (tree scope, tree name, else { name_hint hint; - if (SCOPED_ENUM_P (scope)) + if (SCOPED_ENUM_P (scope) && TREE_CODE (name) == IDENTIFIER_NODE) hint = suggest_alternative_in_scoped_enum (name, scope); if (const char *suggestion = hint.suggestion ()) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 41375758005..d12d51ff2d6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-02-19 Jakub Jelinek + + PR c++/89390 + * g++.dg/diagnostic/pr89390.C: New test. + 2019-02-18 Sharon Dvir * README: Fix typos. diff --git a/gcc/testsuite/g++.dg/diagnostic/pr89390.C b/gcc/testsuite/g++.dg/diagnostic/pr89390.C new file mode 100644 index 00000000000..8dae827a219 --- /dev/null +++ b/gcc/testsuite/g++.dg/diagnostic/pr89390.C @@ -0,0 +1,10 @@ +// PR c++/89390 +// { dg-do compile { target c++11 } } + +enum class A { B, C }; + +void +foo () +{ + A::~A (); // { dg-error "'~A' is not a member of 'A'" "" { target *-*-* } 0 } +}