[PR c++/90754] name lookup ICE
authorNathan Sidwell <nathan@acm.org>
Mon, 17 Jun 2019 13:46:59 +0000 (13:46 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Mon, 17 Jun 2019 13:46:59 +0000 (13:46 +0000)
https://gcc.gnu.org/ml/gcc-patches/2019-06/msg00952.html
PR c++/90754
* name-lookup.c (lookup_type_scope_1): Calll qualify_lookup before
checking context.

PR c++/90754
* g++.dg/lookup/pr90754.C: New.

From-SVN: r272384

gcc/cp/ChangeLog
gcc/cp/name-lookup.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/lookup/pr90754.C [new file with mode: 0644]

index ad353142a2fc2fb5f354f7be678a2aa00d0d6e31..4e6d62627ec873697740fa0bd43e2c9b3ab16715 100644 (file)
@@ -1,3 +1,9 @@
+2019-06-17  Nathan Sidwell  <nathan@acm.org>
+
+       PR c++/90754
+       * name-lookup.c (lookup_type_scope_1): Calll qualify_lookup before
+       checking context.
+
 2019-06-14  Marek Polacek  <polacek@redhat.com>
 
        PR c++/90884 - stray note with -Wctor-dtor-privacy.
index 632253a0d8c38732cfd896b3fa3e39f31b8cefa6..f4c34ed6a29ba49a7fb235a415aeac70c2bffe72 100644 (file)
@@ -6487,15 +6487,15 @@ lookup_type_scope_1 (tree name, tag_scope scope)
             typedef struct C {} C;
           correctly.  */
        if (tree type = iter->type)
-         if ((scope != ts_current
-              || LOCAL_BINDING_P (iter)
-              || DECL_CONTEXT (type) == iter->scope->this_entity)
-             && qualify_lookup (iter->type, LOOKUP_PREFER_TYPES))
-           return iter->type;
-
-       if ((scope != ts_current
-            || !INHERITED_VALUE_BINDING_P (iter))
-           && qualify_lookup (iter->value, LOOKUP_PREFER_TYPES))
+         if (qualify_lookup (type, LOOKUP_PREFER_TYPES)
+             && (scope != ts_current
+                 || LOCAL_BINDING_P (iter)
+                 || DECL_CONTEXT (type) == iter->scope->this_entity))
+           return type;
+
+       if (qualify_lookup (iter->value, LOOKUP_PREFER_TYPES)
+           && (scope != ts_current
+               || !INHERITED_VALUE_BINDING_P (iter)))
          return iter->value;
       }
 
index aba3d20d8a7b77e7d1f661235a6b81ff45fca6c2..13cd4699a90de93f23b4434e245bcdc1063e7796 100644 (file)
@@ -1,3 +1,8 @@
+2019-06-17  Nathan Sidwell  <nathan@acm.org>
+
+       PR c++/90754
+       * g++.dg/lookup/pr90754.C: New.
+
 2019-06-17  Wilco Dijkstra  <wdijkstr@arm.com>
 
        PR middle-end/64242
diff --git a/gcc/testsuite/g++.dg/lookup/pr90754.C b/gcc/testsuite/g++.dg/lookup/pr90754.C
new file mode 100644 (file)
index 0000000..f68f6d4
--- /dev/null
@@ -0,0 +1,11 @@
+// PR c++/90754 ICE in type lookup.
+
+class A {
+  struct COMTypeInfo;
+};
+class B {
+  struct COMTypeInfo;
+};
+class C : A, B {
+  struct COMTypeInfo;
+};