Bug 97112 - class-deduction-alias1.C ICEs with -std=c++17
Summary: class-deduction-alias1.C ICEs with -std=c++17
Status: RESOLVED DUPLICATE of bug 99008
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 11.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: error-recovery, ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2020-09-18 14:09 UTC by Marek Polacek
Modified: 2021-04-14 16:00 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Polacek 2020-09-18 14:09:12 UTC
$ ./cc1plus -quiet class-deduction-alias1.C
class-deduction-alias1.C:6:20: error: ‘concept’ does not name a type
    6 | template <class T> concept Int = __is_same_as (T, int);
      |                    ^~~~~~~
class-deduction-alias1.C:6:20: note: ‘concept’ only available with ‘-std=c++20’ or ‘-fconcepts’
class-deduction-alias1.C:17:10: error: ‘Int’ has not been declared
   17 | template<Int W>
      |          ^~~
class-deduction-alias1.C:18:13: error: ‘W’ was not declared in this scope
   18 | using B = A<W>;
      |             ^
class-deduction-alias1.C:18:14: error: template argument 1 is invalid
   18 | using B = A<W>;
      |              ^
class-deduction-alias1.C:22:12: warning: alias template deduction only available with ‘-std=c++20’ or ‘-std=gnu++20’
   22 | A a1(&i, &i); // { dg-bogus "" "Deduces A<int>" }
      |            ^
class-deduction-alias1.C:22:12: internal compiler error: in set_constraints, at cp/constraint.cc:1192
0xa02c24 set_constraints(tree_node*, tree_node*)
	/home/mpolacek/src/gcc/gcc/cp/constraint.cc:1192
0xc740c9 alias_ctad_tweaks
	/home/mpolacek/src/gcc/gcc/cp/pt.c:28750
0xc74894 deduction_guides_for
	/home/mpolacek/src/gcc/gcc/cp/pt.c:28861
0xc75131 do_class_deduction
	/home/mpolacek/src/gcc/gcc/cp/pt.c:28966
0xc75d79 do_auto_deduction(tree_node*, tree_node*, tree_node*, int, auto_deduction_context, tree_node*, int)
	/home/mpolacek/src/gcc/gcc/cp/pt.c:29095
0xa7f688 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
	/home/mpolacek/src/gcc/gcc/cp/decl.c:7576
0xba60a3 cp_parser_init_declarator
	/home/mpolacek/src/gcc/gcc/cp/parser.c:21018
0xb98966 cp_parser_simple_declaration
	/home/mpolacek/src/gcc/gcc/cp/parser.c:13818
0xb98508 cp_parser_block_declaration
	/home/mpolacek/src/gcc/gcc/cp/parser.c:13644
0xb981f6 cp_parser_declaration
	/home/mpolacek/src/gcc/gcc/cp/parser.c:13517
0xb982e6 cp_parser_toplevel_declaration
	/home/mpolacek/src/gcc/gcc/cp/parser.c:13546
0xb84e59 cp_parser_translation_unit
	/home/mpolacek/src/gcc/gcc/cp/parser.c:4793
0xbe42d2 c_parse_file()
	/home/mpolacek/src/gcc/gcc/cp/parser.c:44090
0xdb3881 c_common_parse_file()
	/home/mpolacek/src/gcc/gcc/c-family/c-opts.c:1188
Comment 1 Patrick Palka 2021-04-14 16:00:02 UTC
Fixed with PR99008.

*** This bug has been marked as a duplicate of bug 99008 ***