https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113640
Bug ID: 113640
Summary: 'deducing this' lambda invoked multiple times
unexpectedly
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: hewillk at gmail dot com
Target Milestone: ---
#include <iostream>
int main() {
auto l = [](this auto self, int n) {
std::cout << n << " ";
return self;
};
l(1)(42)(100);
}
https://godbolt.org/z/3rEoGsPWe
Clang prints "1 42 100" as expected, however, GCC prints "1 1 42 1 42 100",
which is weird.