Bug 90754 - [10 Regression] ICE: tree check: expected tree that contains ‘decl minimal’ structure, have ‘tree_list’ in lookup_type_scope_1, at cp/name-lookup.c:6492 since r271912
Summary: [10 Regression] ICE: tree check: expected tree that contains ‘decl minimal’ s...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 10.0
: P1 normal
Target Milestone: 10.0
Assignee: Nathan Sidwell
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2019-06-05 08:19 UTC by Martin Liška
Modified: 2019-06-17 13:47 UTC (History)
6 users (show)

See Also:
Host:
Target:
Build:
Known to work: 9.1.0
Known to fail: 10.0
Last reconfirmed: 2019-06-05 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liška 2019-06-05 08:19:28 UTC
Started with Nathan's commit:

$ cat SandboxReporter.ii
class A {
  struct COMTypeInfo;
};
class B {
  struct COMTypeInfo;
};
class C : A, B {
  struct COMTypeInfo;
};

$ g++ SandboxReporter.ii -c
SandboxReporter.ii:8:10: internal compiler error: tree check: expected tree that contains ‘decl minimal’ structure, have ‘tree_list’ in lookup_type_scope_1, at cp/name-lookup.c:6492
    8 |   struct COMTypeInfo;
      |          ^~~~~~~~~~~
0x7e6f91 tree_contains_struct_check_failed(tree_node const*, tree_node_structure_enum, char const*, int, char const*)
	/home/marxin/Programming/gcc/gcc/tree.c:10068
0x6323f0 contains_struct_check(tree_node*, tree_node_structure_enum, char const*, int, char const*)
	/home/marxin/Programming/gcc/gcc/tree.h:3308
0x6323f0 lookup_type_scope_1
	/home/marxin/Programming/gcc/gcc/cp/name-lookup.c:6492
0x6323f0 lookup_type_scope(tree_node*, tag_scope)
	/home/marxin/Programming/gcc/gcc/cp/name-lookup.c:6535
0x925615 lookup_and_check_tag
	/home/marxin/Programming/gcc/gcc/cp/decl.c:13975
0x9259f1 xref_tag_1
	/home/marxin/Programming/gcc/gcc/cp/decl.c:14089
0x9259f1 xref_tag(tag_types, tree_node*, tag_scope, bool)
	/home/marxin/Programming/gcc/gcc/cp/decl.c:14211
0x9d311b cp_parser_elaborated_type_specifier
	/home/marxin/Programming/gcc/gcc/cp/parser.c:18571
0x9c0322 cp_parser_type_specifier
	/home/marxin/Programming/gcc/gcc/cp/parser.c:17438
0x9c1314 cp_parser_decl_specifier_seq
	/home/marxin/Programming/gcc/gcc/cp/parser.c:14108
0x9e3e57 cp_parser_member_declaration
	/home/marxin/Programming/gcc/gcc/cp/parser.c:24392
0x9be72f cp_parser_member_specification_opt
	/home/marxin/Programming/gcc/gcc/cp/parser.c:24247
0x9be72f cp_parser_class_specifier_1
	/home/marxin/Programming/gcc/gcc/cp/parser.c:23388
0x9c03cd cp_parser_class_specifier
	/home/marxin/Programming/gcc/gcc/cp/parser.c:23650
0x9c03cd cp_parser_type_specifier
	/home/marxin/Programming/gcc/gcc/cp/parser.c:17412
0x9c1314 cp_parser_decl_specifier_seq
	/home/marxin/Programming/gcc/gcc/cp/parser.c:14108
0x9c1b11 cp_parser_simple_declaration
	/home/marxin/Programming/gcc/gcc/cp/parser.c:13403
0x9e58e0 cp_parser_declaration
	/home/marxin/Programming/gcc/gcc/cp/parser.c:13222
0x9e605f cp_parser_translation_unit
	/home/marxin/Programming/gcc/gcc/cp/parser.c:4690
0x9e605f c_parse_file()
	/home/marxin/Programming/gcc/gcc/cp/parser.c:41176

$ g++-9 SandboxReporter.ii -c
[OK]
Comment 1 Volker Reichelt 2019-06-17 07:22:06 UTC
Nathan, as your patch broke this, would you mind having a look?
Comment 2 Nathan Sidwell 2019-06-17 13:47:13 UTC
Fixed r272384.
Comment 3 Nathan Sidwell 2019-06-17 13:47:31 UTC
Author: nathan
Date: Mon Jun 17 13:46:59 2019
New Revision: 272384

URL: https://gcc.gnu.org/viewcvs?rev=272384&root=gcc&view=rev
Log:
[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.

Added:
    trunk/gcc/testsuite/g++.dg/lookup/pr90754.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/name-lookup.c
    trunk/gcc/testsuite/ChangeLog