[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
This commit is contained in:
Nathan Sidwell 2019-06-17 13:46:59 +00:00 committed by Nathan Sidwell
parent 07c8304c06
commit 41d93b16ca
4 changed files with 30 additions and 8 deletions

View 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.

View 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 (qualify_lookup (type, LOOKUP_PREFER_TYPES)
&& (scope != ts_current
|| LOCAL_BINDING_P (iter)
|| DECL_CONTEXT (type) == iter->scope->this_entity))
return type;
if ((scope != ts_current
|| !INHERITED_VALUE_BINDING_P (iter))
&& qualify_lookup (iter->value, LOOKUP_PREFER_TYPES))
if (qualify_lookup (iter->value, LOOKUP_PREFER_TYPES)
&& (scope != ts_current
|| !INHERITED_VALUE_BINDING_P (iter)))
return iter->value;
}

View 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

View File

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