public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/108998] New: ICE in tsubst, at cp/pt.cc:16037
@ 2023-03-02 23:54 waffl3x at protonmail dot com
  2023-03-03  0:03 ` [Bug c++/108998] " waffl3x at protonmail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: waffl3x at protonmail dot com @ 2023-03-02 23:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108998

            Bug ID: 108998
           Summary: ICE in tsubst, at cp/pt.cc:16037
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: waffl3x at protonmail dot com
  Target Milestone: ---

Created attachment 54573
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54573&action=edit
the output of -v on godbolt at the time of posting this report

template<int L, typename T>
inline constexpr bool templ = false;

template<typename T>
void ice(T a)
{
    auto aa = a;
    auto lambda = []<int I>(){
        if constexpr (templ<I, decltype(aa)>) {}
    };
    lambda.template operator()<0>();
}

void go() {
    ice(0);
}

https://godbolt.org/z/4qn9s6cad

The conditions for this were rather complicated, this was as far as I could
reduce it. Some things to note,
it does not trigger when the lambda's template parameter is a type parameter,
it does not trigger with an auto function parameter,
it does not trigger outside of if constexpr,
and it does not trigger when the first argument to templ is not a lambda's
template parameter.
I couldn't find a way to trigger it without a lambda's non type template
parameter.

<source>: In instantiation of 'ice<int>(int)::<lambda()> [with int I = 0]':
<source>:11:34:   required from 'void ice(T) [with T = int]'
<source>:15:8:   required from here
<source>:7:10: internal compiler error: in tsubst, at cp/pt.cc:16037
    7 |     auto aa = a;
      |          ^~
0x247996e internal_error(char const*, ...)
        ???:0
0xae93fe fancy_abort(char const*, int, char const*)
        ???:0
0xd11fdd tsubst(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xd13f4d tsubst_template_args(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xd09c65 instantiate_decl(tree_node*, bool, bool)
        ???:0
0xbdf731 maybe_instantiate_decl(tree_node*)
        ???:0
0xbe11be mark_used(tree_node*, int)
        ???:0
0xb16f0e build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, tree_node**, int)
        ???:0
0xd09c65 instantiate_decl(tree_node*, bool, bool)
        ???:0
0xd35ffb instantiate_pending_templates(int)
        ???:0
0xbe4325 c_parse_final_cleanups()
        ???:0
0xe215f8 c_common_parse_file()
        ???:0

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-05-22  3:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-02 23:54 [Bug c++/108998] New: ICE in tsubst, at cp/pt.cc:16037 waffl3x at protonmail dot com
2023-03-03  0:03 ` [Bug c++/108998] " waffl3x at protonmail dot com
2023-03-03  0:06 ` [Bug c++/108998] [13 Regression] " mpolacek at gcc dot gnu.org
2023-03-03  0:07 ` waffl3x at protonmail dot com
2023-03-03 14:09 ` ppalka at gcc dot gnu.org
2023-03-03 15:14 ` [Bug c++/108998] [12/13 " ppalka at gcc dot gnu.org
2023-03-03 16:37 ` cvs-commit at gcc dot gnu.org
2023-03-03 16:39 ` [Bug c++/108998] [12 " ppalka at gcc dot gnu.org
2023-03-07  2:18 ` cvs-commit at gcc dot gnu.org
2023-03-07  2:21 ` ppalka at gcc dot gnu.org
2023-05-22  3:12 ` cvs-commit 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).