[Clang][OpenMP] Fix the issue that a functor is not captured properly in a task region
authorShilei Tian <i@tianshilei.me>
Tue, 17 Jan 2023 03:34:14 +0000 (22:34 -0500)
committerShilei Tian <i@tianshilei.me>
Tue, 17 Jan 2023 03:35:05 +0000 (22:35 -0500)
commitae53c7f4a21104e2eb84139f3ce4c468e2632590
tree2cc4c600b7468e1fb45ab54ec98e64ce001f5c90
parent61fa12d0c78b5624914b8bd7937eba03f8973434
[Clang][OpenMP] Fix the issue that a functor is not captured properly in a task region

This patch fixes the issue that a functor is not captured properly if
that is used in a task region. It was introduced by https://reviews.llvm.org/D114546
where `CallExpr` is treated specially, but the callee itself is not properly visited.
https://reviews.llvm.org/D115902 already did some fix for one case. This patch
fixes another case.

Fix #57757.

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D141873
clang/lib/Sema/SemaOpenMP.cpp
clang/test/OpenMP/bug57757.cpp [new file with mode: 0644]