diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-08-20 12:15:57 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-08-20 12:15:57 +0000 |
commit | 1185e193a486881c5685e581e818f6f667b61bfb (patch) | |
tree | ee262bf2833f269cfb4679751a298fa888579550 /clang/lib/Sema/SemaOpenMP.cpp | |
parent | c6a144b0aaa0df954423a13c1804bfe0538bd21f (diff) | |
download | bcm5719-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.cpp | 6 |
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. |