https://bugs.llvm.org/show_bug.cgi?id=49637
Bug ID: 49637
Summary: clang accepts "this" reference in default argument of
lambda
Product: clang
Version: unspecified
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected]
Testcase:
struct A {
void f();
static int g(A**);
int g(A*) const;
};
void A::f() {
auto z = [](auto a, int r = g(decltype(a)(0))) {};
z((A*)0);
}
gcc gives the following error:
<source>: In lambda function:
<source>:7:34: error: cannot call member function 'int A::g(A*) const' without
object
7 | auto z = [](auto a, int r = g(decltype(a)(0))) {};
| ~^~~~~~~~~~~~~~~~
<source>:8:12: note: when instantiating default argument for call to
'A::f()::<lambda(auto:1, int)> [with auto:1 = A*]'
8 | z((A*)0);
| ^
--
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