[Flang][OpenMP] Fix to variables not inheriting data sharing attributes (#79017)
commit47bcc91e06798e8730983b3848cc152a79c7afae
authorharishch4 <harishcse44@gmail.com>
Tue, 23 Jan 2024 09:46:49 +0000 (23 15:16 +0530)
committerGitHub <noreply@github.com>
Tue, 23 Jan 2024 09:46:49 +0000 (23 15:16 +0530)
tree8539f2c1a849caeae6dfbe69fbd238d416599508
parent60e1c835d326a74ef67bf4b9399d439262d0380e
[Flang][OpenMP] Fix to variables not inheriting data sharing attributes (#79017)

When a default(none) clause exists and a threadprivate variable is used
inside the construct, the variable does not inherit threadprivate
behavior and throws the below error.

> error: The DEFAULT(NONE) clause requires that 'a' must be listed in a
data-sharing attribute clause

Added a condition to skip the error if it is a threadprivate variable.

Fixes: https://github.com/llvm/llvm-project/issues/49545
flang/lib/Semantics/resolve-directives.cpp
flang/test/Lower/OpenMP/threadprivate-default-clause.f90 [new file with mode: 0644]