public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/107579] New: ICE on fold-expression on .* member access operator
@ 2022-11-08 19:52 jeanmichael.celerier at gmail dot com
  2022-11-08 19:58 ` [Bug c++/107579] " jeanmichael.celerier at gmail dot com
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: jeanmichael.celerier at gmail dot com @ 2022-11-08 19:52 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107579
           Summary: ICE on fold-expression on .* member access operator
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jeanmichael.celerier at gmail dot com
  Target Milestone: ---

The function that is causing the ICE:

```
constexpr int index_in_struct(const auto& s, auto... member)
{
  int index = -1;
  int k = 0;

  avnd::for_each_field_ref(s, [&](auto& m) {
    if constexpr(requires { bool(&m == &(s.*....*member)); })
    {
      if(&m == &(s.*....*member))
      {
        index = k;
      }
    }
    ++k;
  });
  assert(index >= 0);
  return index;
}
```

The error:

/home/jcelerier/score/3rdparty/avendish/include/avnd/common/for_nth.hpp:114:26:
internal compiler error: trying to capture 'member#0' in instantiation of
generic lambda
  114 |       if(&m == &(s.*....*member))
      |                          ^~~~~~
0x19eab38 internal_error(char const*, ...)
        ???:0
0x71c547 add_capture(tree_node*, tree_node*, tree_node*, bool, bool)
        ???:0
0x71c5b3 add_default_capture(tree_node*, tree_node*, tree_node*)
        ???:0
0x7e232a tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ???:0
0x7e0baa tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ???:0
0x7e8d8c tsubst_pack_expansion(tree_node*, tree_node*, int, tree_node*)
        ???:0
0x7dff89 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ???:0
0x7e0d41 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ???:0
0x7dfdeb tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ???:0
0x7db043 instantiate_decl(tree_node*, bool, bool)
        ???:0
0x6edb1b mark_used(tree_node*, int)
        ???:0
0x68b85f build_op_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, int)
        ???:0
0x810f2d finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
        ???:0
0x7e1f0c tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ???:0
0x7e8d8c tsubst_pack_expansion(tree_node*, tree_node*, int, tree_node*)
        ???:0
0x7dff89 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ???:0
0x7db043 instantiate_decl(tree_node*, bool, bool)
        ???:0
0x6edb1b mark_used(tree_node*, int)
        ???:0
0x68b85f build_op_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, int)
        ???:0
0x810f2d finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
        ???:0

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

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

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-08 19:52 [Bug c++/107579] New: ICE on fold-expression on .* member access operator jeanmichael.celerier at gmail dot com
2022-11-08 19:58 ` [Bug c++/107579] " jeanmichael.celerier at gmail dot com
2022-11-08 20:00 ` jeanmichael.celerier at gmail dot com
2022-11-08 20:24 ` jeanmichael.celerier at gmail dot com
2022-11-08 20:25 ` jeanmichael.celerier at gmail dot com
2022-11-09  7:18 ` [Bug c++/107579] [11/12/13 Regression] " rguenth at gcc dot gnu.org
2022-11-21 11:40 ` marxin at gcc dot gnu.org
2022-11-21 11:41 ` [Bug c++/107579] [11/12/13 Regression] ICE on fold-expression on .* member access operator since r12-2862-g9707d2e5dbb92d2b marxin at gcc dot gnu.org
2022-12-09 21:00 ` ppalka at gcc dot gnu.org
2022-12-15 21:03 ` cvs-commit at gcc dot gnu.org
2022-12-15 21:03 ` ppalka at gcc dot gnu.org
2022-12-19 16:54 ` [Bug c++/107579] [11/12 " cvs-commit at gcc dot gnu.org
2023-05-22  3:12 ` [Bug c++/107579] [11 " cvs-commit at gcc dot gnu.org
2023-05-22  3:15 ` ppalka 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).