https://bugs.llvm.org/show_bug.cgi?id=47564
Bug ID: 47564
Summary: auto trick for recursive lambdas works with gcc, but
not always with clang
Product: clang
Version: 10.0
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++14
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected]
Created attachment 23976
--> https://bugs.llvm.org/attachment.cgi?id=23976&action=edit
example file illustrating the bug
Take this example:
auto const f([](int const i, auto ...) noexcept -> int
{
return i == 1 ? 1 : i * operator()(i - 1);
}
);
under gcc 10.2.0 the lambda will compile and work as expected - and will do so
every time an auto argument is used, but clang 10.0.1 reports:
t.cpp:6:31: error: use of undeclared 'operator()'
If I omit the auto arguments with gcc, it reports:
t.cpp:6:31: error: 'operator()' not defined
However, the auto trick does work with clang - I have more complex lambdas with
which it does work. I find the trick very useful. Could you make it work with
clang every time, just like is the case with gcc?
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs