public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99833] New: structured binding + if init + generic lambda = internal compiler error
@ 2021-03-30 17:17 nickgray0 at brown dot edu
  2021-03-30 20:24 ` [Bug c++/99833] [8/9/10/11 Regression] " mpolacek at gcc dot gnu.org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: nickgray0 at brown dot edu @ 2021-03-30 17:17 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99833
           Summary: structured binding + if init + generic lambda =
                    internal compiler error
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nickgray0 at brown dot edu
  Target Milestone: ---
             Build: -std=c++20

as the title suggests, the following code triggers an internal compiler error:

    #include <tuple>

    auto f(auto&& x) {
        [&](auto...) {
            auto y = std::tuple{ "what's happening here?", x };
            if constexpr (auto [_, z] = y; requires { z; })
                return;
        }();
    }

    auto main()->int {
        f(42);
    }

error message: <source>:6:36: internal compiler error: in tsubst_decomp_names,
at cp/pt.c:18034
    6 |                 if constexpr (auto [_, z] = y; requires { z; })
      |                                    ^~~~~~
0x1cfb6a9 internal_error(char const*, ...)
        ???:0
0x6ba871 fancy_abort(char const*, int, char const*)
        ???:0
0x91c84f instantiate_decl(tree_node*, bool, bool)
        ???:0
0x7c6c0e maybe_instantiate_decl(tree_node*)
        ???:0
0x7c8370 mark_used(tree_node*, int)
        ???:0
0x6e2835 build_op_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, int)
        ???:0
0x980ae5 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
        ???:0
0x91c84f instantiate_decl(tree_node*, bool, bool)
        ???:0
0x7c6c0e maybe_instantiate_decl(tree_node*)
        ???:0
0x7c8370 mark_used(tree_node*, int)
        ???:0
0x6de097 build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
        ???:0
0x980c6c finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
        ???:0
0x8e12ad c_parse_file()
        ???:0
0xa600a2 c_common_parse_file()
        ???:0


either moving the structured binding outside of if statement or making the
lambda non-generic seems to solve the problem.

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

end of thread, other threads:[~2021-04-22 17:11 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30 17:17 [Bug c++/99833] New: structured binding + if init + generic lambda = internal compiler error nickgray0 at brown dot edu
2021-03-30 20:24 ` [Bug c++/99833] [8/9/10/11 Regression] " mpolacek at gcc dot gnu.org
2021-03-30 20:57 ` mpolacek at gcc dot gnu.org
2021-03-30 20:58 ` mpolacek at gcc dot gnu.org
2021-03-30 21:28 ` ppalka at gcc dot gnu.org
2021-03-31  7:56 ` rguenth at gcc dot gnu.org
2021-03-31 17:24 ` ppalka at gcc dot gnu.org
2021-04-14  9:40 ` jakub at gcc dot gnu.org
2021-04-14  9:54 ` jakub at gcc dot gnu.org
2021-04-14 10:36 ` jakub at gcc dot gnu.org
2021-04-14 11:14 ` jakub at gcc dot gnu.org
2021-04-14 12:25 ` ppalka at gcc dot gnu.org
2021-04-16  7:33 ` cvs-commit at gcc dot gnu.org
2021-04-16  7:35 ` [Bug c++/99833] [8/9/10 " jakub at gcc dot gnu.org
2021-04-20  9:46 ` cvs-commit at gcc dot gnu.org
2021-04-20  9:53 ` [Bug c++/99833] [8/9 " jakub at gcc dot gnu.org
2021-04-20 23:34 ` cvs-commit at gcc dot gnu.org
2021-04-22 16:53 ` cvs-commit at gcc dot gnu.org
2021-04-22 17:11 ` jakub 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).