https://bugs.llvm.org/show_bug.cgi?id=39694
Bug ID: 39694
Summary: [OpenMP] Seg-fault caused by this-capturing lambda in
#pragma omp parallel
Product: OpenMP
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Clang Compiler Support
Assignee: unassignedclangb...@nondot.org
Reporter: erich.ke...@intel.com
CC: llvm-bugs@lists.llvm.org
AS of r345609, OpenMP supports mapping lambdas in target regions. However, if
the lambda captures 'this', and we're no-longer local to the lambda's 'this',
the call on this line:
(https://github.com/llvm-mirror/clang/commit/36950cc24f63a783faf9a3db208120b496fd8a84#diff-fb23039c21cc555ae2fb3106a2426fb5R1555
to CheckCXXThisCapture seg-faults because the Sema "Active This Type" doesn't
exist.
Godbolt link here: https://godbolt.org/z/W26nsv
Min Reproducer is:
template <typename _Op> void algo(_Op __o) {
#pragma omp parallel
(void)__o;
}
struct S {
void Foo() {
algo([this]() {});
}
};
NOTE that the crash only happens when this is a 'free' function. More
insidiously, if the algorithm itself is in a structure
(https://godbolt.org/z/_aKG6l), 'this' will capture the wrong thing (see line
36 in the AST output).
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs