public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95451] New: [8/9/10 regression] ICE for lambda capturing this and calling operator()
@ 2020-05-31 14:33 max.kanold@nu-cost.com
  2020-05-31 14:39 ` [Bug c++/95451] " max.kanold@nu-cost.com
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: max.kanold@nu-cost.com @ 2020-05-31 14:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95451
           Summary: [8/9/10 regression] ICE for lambda capturing this and
                    calling operator()
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: max.kanold@nu-cost.com
  Target Milestone: ---

The following legal code will lead to an Internal Compiler Error, see
https://godbolt.org/z/PoyMEL

================================
struct A {
    template<typename>
    void function_with_lambda() {
        [this](auto) {
            /*this->*/operator()();
        };
    }

    void operator()() {}
};

int main() {
    A{}.function_with_lambda<void>();
}
================================

A simple workaround is explicitely adding "this->" before the function call.
This is familiar to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86594, where
the same workaround prevents the ICE.

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

end of thread, other threads:[~2021-12-10 12:20 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-31 14:33 [Bug c++/95451] New: [8/9/10 regression] ICE for lambda capturing this and calling operator() max.kanold@nu-cost.com
2020-05-31 14:39 ` [Bug c++/95451] " max.kanold@nu-cost.com
2020-06-01  8:36 ` [Bug c++/95451] [8/9/10 regression] ICE for lambda capturing this and calling operator() since r8-2720-gf44a8dd56f5bfbd0 marxin at gcc dot gnu.org
2020-06-02  7:32 ` [Bug c++/95451] [8/9/10/11 " rguenth at gcc dot gnu.org
2021-01-14  8:56 ` rguenth at gcc dot gnu.org
2021-02-25 11:51 ` jakub at gcc dot gnu.org
2021-02-25 16:15 ` jakub at gcc dot gnu.org
2021-02-26  9:44 ` cvs-commit at gcc dot gnu.org
2021-02-26  9:48 ` [Bug c++/95451] [8/9/10 " jakub at gcc dot gnu.org
2021-03-12  0:20 ` mpolacek at gcc dot gnu.org
2021-03-12  0:23 ` mpolacek at gcc dot gnu.org
2021-03-18 10:50 ` jakub at gcc dot gnu.org
2021-03-19 23:29 ` cvs-commit at gcc dot gnu.org
2021-03-20  8:08 ` [Bug c++/95451] [8/9 " jakub at gcc dot gnu.org
2021-04-20 23:33 ` cvs-commit at gcc dot gnu.org
2021-04-22 16:51 ` cvs-commit at gcc dot gnu.org
2021-04-22 17:06 ` jakub at gcc dot gnu.org
2021-12-10 12:20 ` pinskia 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).