https://github.com/llvm/llvm-project/issues/56884
The root problem is in isOpenMPRebuildMemberExpr, it is only need to rebuild
for field expression. No need for member function call.
The fix is to check field for member expression and skip rebuild for member
function call.
Differential Revision: https://reviews.llvm.org/
D131024
(cherry picked from commit
a7bca18bc50cd2483fded0c77706980b2721ce6a)
}
bool Sema::isOpenMPRebuildMemberExpr(ValueDecl *D) {
+ // Only rebuild for Field.
+ if (!dyn_cast<FieldDecl>(D))
+ return false;
DSAStackTy::DSAVarData DVarPrivate = DSAStack->hasDSA(
D,
[](OpenMPClauseKind C, bool AppliedToPointee,
return 0;
}
+
+class A{
+ void a() {
+ #pragma omp parallel
+ a(b); // expected-error {{use of undeclared identifier 'b'}}
+ }
+};