summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaOpenMP.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2015-08-20 12:15:57 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2015-08-20 12:15:57 +0000
commit1185e193a486881c5685e581e818f6f667b61bfb (patch)
treeee262bf2833f269cfb4679751a298fa888579550 /clang/lib/Sema/SemaOpenMP.cpp
parentc6a144b0aaa0df954423a13c1804bfe0538bd21f (diff)
downloadbcm5719-llvm-1185e193a486881c5685e581e818f6f667b61bfb.tar.gz
bcm5719-llvm-1185e193a486881c5685e581e818f6f667b61bfb.zip
[OPENMP 4.1] Allow to use 'uval' and 'ref' modifiers for reference types only.
Standard allows to use 'uval' and 'ref' modifiers in 'linear' clause for variables with reference types only. Added check for it and modified test. llvm-svn: 245556
Diffstat (limited to 'clang/lib/Sema/SemaOpenMP.cpp')
-rw-r--r--clang/lib/Sema/SemaOpenMP.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index 33bc621afab..d2653b7cb90 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -6383,6 +6383,12 @@ OMPClause *Sema::ActOnOpenMPLinearClause(
diag::err_omp_linear_incomplete_type)) {
continue;
}
+ if ((LinKind == OMPC_LINEAR_uval || LinKind == OMPC_LINEAR_ref) &&
+ !QType->isReferenceType()) {
+ Diag(ELoc, diag::err_omp_wrong_linear_modifier_non_reference)
+ << QType << getOpenMPSimpleClauseTypeName(OMPC_linear, LinKind);
+ continue;
+ }
QType = QType.getNonReferenceType();
// A list item must not be const-qualified.
OpenPOWER on IntegriCloud