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
This commit is contained in:
Jakub Jelinek 2019-02-19 09:38:54 +01:00 committed by Jakub Jelinek
parent 102a4fe17e
commit 883c07964f
4 changed files with 22 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2019-02-19 Jakub Jelinek <jakub@redhat.com>
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 <tom@honermann.net>
* name-lookup.c (get_std_name_hint): Added u8string as a name hint.

View file

@ -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 ())
{

View file

@ -1,3 +1,8 @@
2019-02-19 Jakub Jelinek <jakub@redhat.com>
PR c++/89390
* g++.dg/diagnostic/pr89390.C: New test.
2019-02-18 Sharon Dvir <unapologtic@gmail.com>
* README: Fix typos.

View file

@ -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 }
}