https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116477
Bug ID: 116477
Summary: ICE in instantiate_decl, instead of "cannot use
concept as function"
Product: gcc
Version: 14.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: michael at cadilhac dot name
Target Milestone: ---
This appears from 10.1 to current trunk, according to Godbolt.
Source:
--- file.cc
#include <concepts>
template <typename G>
bool run () {
return std::regular<G> (G{});
}
int main () {
run<int> ();
}
---
Compile:
---
$ g++ --version
g++ (GCC) 14.2.1 20240805
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ g++ file.cc -std=c++20
b.cc: In instantiation of ‘bool run() [with G = int]’:
b.cc:9:12: required from here
9 | run<int> ();
| ~~~~~~~~~^~
b.cc:5:28: internal compiler error: in tsubst_expr, at cp/pt.cc:21118
5 | return std::regular<G> (G{});
| ~~~~~~~~~~~~~~~~^~~~~
0x21a7bea internal_error(char const*, ...)
???:0
0x703e99 fancy_abort(char const*, int, char const*)
???:0
0x8ca115 instantiate_decl(tree_node*, bool, bool)
???:0
0x8f0103 instantiate_pending_templates(int)
???:0
0x7ce561 c_parse_final_cleanups()
???:0
0x9cc18a c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/issues>
for instructions.
$
---