diff options
author | Joel E. Denny <jdenny.ornl@gmail.com> | 2019-01-04 22:11:31 +0000 |
---|---|---|
committer | Joel E. Denny <jdenny.ornl@gmail.com> | 2019-01-04 22:11:31 +0000 |
commit | f21e62190820e0ae3570ba617043e42a64c1582b (patch) | |
tree | fdea367f7696c109cc61b35203b77e998a2dde03 /include/clang/Basic/DiagnosticSemaKinds.td | |
parent | a615149ee4fd2b6d97dc029c8827e42b025e1379 (diff) |
[OpenMP] Replace predetermined shared for const variable
The following appears in OpenMP 3.1 sec. 2.9.1.1 as a predetermined
data-sharing attribute:
> Variables with const-qualified type having no mutable member are
> shared.
It does not appear in OpenmP 4.0, 4.5, or 5.0. This patch removes the
implementation of that attribute when the requested OpenMP version is
greater than 3.1.
One effect of that removal is that `default(none)` affects const
variables without mutable members.
Also, without this patch, if a const variable without mutable members
was explicitly lastprivate or private, it was an error because it was
predetermined shared. Now, clang instead complains that it's const
without mutable fields, which is a more intelligible diagnostic. That
should be fine for all of the above versions because they all have
something like the following, which is quoted from OpenMP 5.0
sec. 2.19.3:
> A variable that is privatized must not have a const-qualified type
> unless it is of class type with a mutable member. This restriction does
> not apply to the firstprivate clause.
reduction and linear clauses already have separate checks for const
variables. Future patches will merge the implementations.
Reviewed By: ABataev
Differential Revision: https://reviews.llvm.org/D56113
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350439 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/DiagnosticSemaKinds.td')
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 0f30aed960..da0bb5d987 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -8778,6 +8778,8 @@ def err_omp_required_access : Error< "%0 variable must be %1">; def err_omp_const_variable : Error< "const-qualified variable cannot be %0">; +def err_omp_const_not_mutable_variable : Error< + "const-qualified variable without mutable fields cannot be %0">; def err_omp_const_reduction_list_item : Error< "const-qualified list item cannot be reduction">; def err_omp_linear_incomplete_type : Error< |