public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug c++/109692] New: ICE on concept as default template parameter to iife lambda in fold expression in static member template function @ 2023-05-02 6:17 rl.alt.accnt at gmail dot com 2023-05-02 14:26 ` [Bug c++/109692] [12/13/14 Regression] ICE on concept as default template parameter to iife lambda in fold expression in static member template function since r12-8110-ge2c7070ac77405 marxin at gcc dot gnu.org ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: rl.alt.accnt at gmail dot com @ 2023-05-02 6:17 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109692 Bug ID: 109692 Summary: ICE on concept as default template parameter to iife lambda in fold expression in static member template function Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: rl.alt.accnt at gmail dot com Target Milestone: --- The following code raises an ICE on GCC (trunk) and all versions later than and including GCC 11.3. Earlier versions simply fail to instantiate the template. Both Clang and MSVC accept the code (see also this godbolt link: https://godbolt.org/z/x5Ys9sPzx): ```c++ template <typename opt> concept always_true = true; template <typename ...params> struct variadic { template <typename opt> static void callee() { } static void bug() { ([]<bool x = always_true<params>>() { if constexpr (x) callee<params>(); }(), ...); } }; int main() { variadic<int>::bug(); } ``` GCC (trunk) on godbolt gives me this stack trace: <source>: In instantiation of 'variadic<int>::bug()::<lambda()> [with bool x = true]': <source>:9:10: required from 'static void variadic<params>::bug() [with params = {int}]' <source>:13:32: required from here <source>:8:44: error: template argument 1 is invalid 8 | if constexpr (x) callee<params>(); | ~~~~~~~~~~~~~~^~ <source>:8:44: error: template argument 1 is invalid <source>:8:44: internal compiler error: in constructor_name_p, at cp/name-lookup.cc:4721 0x23605ae internal_error(char const*, ...) ???:0 0xa6dd64 fancy_abort(char const*, int, char const*) ???:0 0xc81ee5 instantiate_decl(tree_node*, bool, bool) ???:0 0xb5c9e1 maybe_instantiate_decl(tree_node*) ???:0 0xb5e45e mark_used(tree_node*, int) ???:0 0xa9da44 build_op_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, int) ???:0 0xcc7264 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, bool, int) ???:0 0xc79864 tsubst_pack_expansion(tree_node*, tree_node*, int, tree_node*) ???:0 0xc81ee5 instantiate_decl(tree_node*, bool, bool) ???:0 0xcad44b instantiate_pending_templates(int) ???:0 0xb61635 c_parse_final_cleanups() ???:0 0xd91568 c_common_parse_file() ???:0 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/109692] [12/13/14 Regression] ICE on concept as default template parameter to iife lambda in fold expression in static member template function since r12-8110-ge2c7070ac77405 2023-05-02 6:17 [Bug c++/109692] New: ICE on concept as default template parameter to iife lambda in fold expression in static member template function rl.alt.accnt at gmail dot com @ 2023-05-02 14:26 ` marxin at gcc dot gnu.org 2023-05-03 3:49 ` pinskia at gcc dot gnu.org 2024-01-12 10:43 ` rguenth at gcc dot gnu.org 2 siblings, 0 replies; 4+ messages in thread From: marxin at gcc dot gnu.org @ 2023-05-02 14:26 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109692 Martin Liška <marxin at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|ICE on concept as default |[12/13/14 Regression] ICE |template parameter to iife |on concept as default |lambda in fold expression |template parameter to iife |in static member template |lambda in fold expression |function |in static member template | |function since | |r12-8110-ge2c7070ac77405 Last reconfirmed| |2023-05-02 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 CC| |marxin at gcc dot gnu.org, | |ppalka at gcc dot gnu.org --- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> --- Started with r12-8110-ge2c7070ac77405. ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/109692] [12/13/14 Regression] ICE on concept as default template parameter to iife lambda in fold expression in static member template function since r12-8110-ge2c7070ac77405 2023-05-02 6:17 [Bug c++/109692] New: ICE on concept as default template parameter to iife lambda in fold expression in static member template function rl.alt.accnt at gmail dot com 2023-05-02 14:26 ` [Bug c++/109692] [12/13/14 Regression] ICE on concept as default template parameter to iife lambda in fold expression in static member template function since r12-8110-ge2c7070ac77405 marxin at gcc dot gnu.org @ 2023-05-03 3:49 ` pinskia at gcc dot gnu.org 2024-01-12 10:43 ` rguenth at gcc dot gnu.org 2 siblings, 0 replies; 4+ messages in thread From: pinskia at gcc dot gnu.org @ 2023-05-03 3:49 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109692 Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |12.4 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/109692] [12/13/14 Regression] ICE on concept as default template parameter to iife lambda in fold expression in static member template function since r12-8110-ge2c7070ac77405 2023-05-02 6:17 [Bug c++/109692] New: ICE on concept as default template parameter to iife lambda in fold expression in static member template function rl.alt.accnt at gmail dot com 2023-05-02 14:26 ` [Bug c++/109692] [12/13/14 Regression] ICE on concept as default template parameter to iife lambda in fold expression in static member template function since r12-8110-ge2c7070ac77405 marxin at gcc dot gnu.org 2023-05-03 3:49 ` pinskia at gcc dot gnu.org @ 2024-01-12 10:43 ` rguenth at gcc dot gnu.org 2 siblings, 0 replies; 4+ messages in thread From: rguenth at gcc dot gnu.org @ 2024-01-12 10:43 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109692 Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P3 |P4 Keywords| |error-recovery, | |ice-on-valid-code, | |rejects-valid --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- So indeed GCC 11.2 doesn't ICE but errors like t.C: In instantiation of 'static void variadic<params>::bug() [with params = {int}]': t.C:13:29: required from here t.C:9:47: error: no match for call to '(variadic<int>::bug()::<lambda()>) ()' 7 | ([]<bool x = always_true<params>>() { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 8 | if constexpr (x) callee<params>(); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 9 | }(), ...); | ~^~ t.C:7:26: note: candidate: 'template<bool x> variadic<int>::bug()::<lambda()>' 7 | ([]<bool x = always_true<params>>() { | ^ t.C:7:26: note: template argument deduction/substitution failed: but I regard we should accept this. Given the ICE is error-recovery the regression should be P4 and that we reject the code isn't a regression. Separating these bugs might be nice. Since it's marked as regression it's P4. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-01-12 10:43 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2023-05-02 6:17 [Bug c++/109692] New: ICE on concept as default template parameter to iife lambda in fold expression in static member template function rl.alt.accnt at gmail dot com 2023-05-02 14:26 ` [Bug c++/109692] [12/13/14 Regression] ICE on concept as default template parameter to iife lambda in fold expression in static member template function since r12-8110-ge2c7070ac77405 marxin at gcc dot gnu.org 2023-05-03 3:49 ` pinskia at gcc dot gnu.org 2024-01-12 10:43 ` rguenth at gcc dot gnu.org
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).