aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/error.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/diagnostic/pr89390.C10
4 files changed, 22 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e2b9be5..21979b5 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index f585d5f..dd3a339 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 4137575..d12d51f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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.
diff --git a/gcc/testsuite/g++.dg/diagnostic/pr89390.C b/gcc/testsuite/g++.dg/diagnostic/pr89390.C
new file mode 100644
index 0000000..8dae827
--- /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 }
+}