This revision was automatically updated to reflect the committed changes. Closed by commit rGa7bca18bc50c: Fix assert during the call to getCanonicalDecl. (authored by jyu2).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131024/new/ https://reviews.llvm.org/D131024 Files: clang/lib/Sema/SemaOpenMP.cpp clang/test/OpenMP/parallel_default_messages.cpp Index: clang/test/OpenMP/parallel_default_messages.cpp =================================================================== --- clang/test/OpenMP/parallel_default_messages.cpp +++ clang/test/OpenMP/parallel_default_messages.cpp @@ -49,3 +49,10 @@ return 0; } + +class A{ + void a() { + #pragma omp parallel + a(b); // expected-error {{use of undeclared identifier 'b'}} + } +}; Index: clang/lib/Sema/SemaOpenMP.cpp =================================================================== --- clang/lib/Sema/SemaOpenMP.cpp +++ clang/lib/Sema/SemaOpenMP.cpp @@ -2270,6 +2270,9 @@ } 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,
Index: clang/test/OpenMP/parallel_default_messages.cpp =================================================================== --- clang/test/OpenMP/parallel_default_messages.cpp +++ clang/test/OpenMP/parallel_default_messages.cpp @@ -49,3 +49,10 @@ return 0; } + +class A{ + void a() { + #pragma omp parallel + a(b); // expected-error {{use of undeclared identifier 'b'}} + } +}; Index: clang/lib/Sema/SemaOpenMP.cpp =================================================================== --- clang/lib/Sema/SemaOpenMP.cpp +++ clang/lib/Sema/SemaOpenMP.cpp @@ -2270,6 +2270,9 @@ } 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,
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits