[clang] Avoid unevaluated implicit private (PR #92055)
Deepak Eachempati via cfe-commits
cfe-commits at lists.llvm.org
Tue May 14 11:43:06 PDT 2024
================
@@ -208,4 +209,39 @@ int main(int argc, char **argv) {
extern template int S<int>::TS;
extern template long S<long>::TS;
+// DUMP-LABEL: FunctionDecl {{.*}} implicit_firstprivate
+void
+implicit_firstprivate() {
+
+#pragma omp parallel num_threads(1)
+ {
+ int i = 0;
+ // DUMP: OMPTaskDirective
+ // DUMP-NEXT: OMPFirstprivateClause
+ // DUMP-NEXT: DeclRefExpr {{.+}} 'i' {{.+}} refers_to_enclosing_variable_or_capture
----------------
dreachem wrote:
This could still match if `non_odr_use_unevaluated` shows up, can't it? Can we add a check that `non_odr_use_unevaluated` should _not_ be part of the `DeclRefRexpr` under this firstprivate clause?
https://github.com/llvm/llvm-project/pull/92055
More information about the cfe-commits
mailing list