Issue 123369
Summary Offset of captures-by-copy is not observable
Labels c++, clang:frontend, rejects-valid, lambda
Assignees
Reporter Endilll
    Consider the following example, courtesy of @erichkeane (https://godbolt.org/z/Tz7arYjvn):
```cpp
int x;
auto lam = [x](auto lam2){ return offsetof(decltype(lam2), x); };
return lam(lam);
```
This is arguably well-formed, because `x` refers to unnamed non-static data member of the lambda per https://eel.is/c++draft/expr.prim.lambda#capture-6.1.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to