aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/ErrorTest.cpp
diff options
context:
space:
mode:
authorTom Eccles <tom.eccles@arm.com>2025-02-06 10:44:16 +0000
committerGitHub <noreply@github.com>2025-02-06 10:44:16 +0000
commit39be2d0266f1aa229a79c47d81b004c8c2079362 (patch)
tree50d935fecbf15de15ca050e65306ce3f2fcea2cd /llvm/unittests/Support/ErrorTest.cpp
parentceaec56fbc94d41a49f56d8e966528e00a46641e (diff)
downloadllvm-39be2d0266f1aa229a79c47d81b004c8c2079362.zip
llvm-39be2d0266f1aa229a79c47d81b004c8c2079362.tar.gz
llvm-39be2d0266f1aa229a79c47d81b004c8c2079362.tar.bz2
[flang][OpenMP][Semantics] Don't allow reduction of derived type components (#125480)
Before this patch, reduction of derived type components crashed the compiler when trying to create the omp.declare_reduction. In OpenMP 3.1 the standard says "a list item that appears in a reduction clause must be a named variable of intrinsic type" (page 106). As I understand it, a derived type component is not a variable. OpenMP 4.0 added declare reduction, partly so that users could define their own reductions on derived types. The above wording was removed from the standard but derived type components were never explicitly allowed. OpenMP 5.0 added "A variable that is part of another variable, with the exception of array elements, cannot appear in17 a reduction clause". All standard versions also require the reduction argument to be "definable", which roughly means that it is a variable. A derived type component is more like an expression. Fixes #125445
Diffstat (limited to 'llvm/unittests/Support/ErrorTest.cpp')
0 files changed, 0 insertions, 0 deletions