From: Nathan Sidwell Date: Mon, 17 Jun 2019 13:46:59 +0000 (+0000) Subject: [PR c++/90754] name lookup ICE X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=41d93b16cac5b348b7883e259f7880b4a0addc23;p=gcc.git [PR c++/90754] name lookup ICE 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ad353142a2f..4e6d62627ec 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2019-06-17 Nathan Sidwell + + PR c++/90754 + * name-lookup.c (lookup_type_scope_1): Calll qualify_lookup before + checking context. + 2019-06-14 Marek Polacek PR c++/90884 - stray note with -Wctor-dtor-privacy. diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 632253a0d8c..f4c34ed6a29 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -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; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index aba3d20d8a7..13cd4699a90 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-06-17 Nathan Sidwell + + PR c++/90754 + * g++.dg/lookup/pr90754.C: New. + 2019-06-17 Wilco Dijkstra 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 index 00000000000..f68f6d4e470 --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/pr90754.C @@ -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; +};