diff options
author | Sven van Haastregt <sven.vanhaastregt@arm.com> | 2019-05-22 13:12:20 +0000 |
---|---|---|
committer | Sven van Haastregt <sven.vanhaastregt@arm.com> | 2019-05-22 13:12:20 +0000 |
commit | ec36dad1b2089ec92370a36615b7828152e34a75 (patch) | |
tree | 3f430d2b8ba8eac6eeec36f1c31cf6c4073ded48 /lib/Sema/SemaType.cpp | |
parent | dc1665e0c4c1261540d881b75c8b97d9121c6eed (diff) | |
download | clang-ec36dad1b2089ec92370a36615b7828152e34a75.tar.gz |
[OpenCL] Support pipe keyword in C++ mode
Support the OpenCL C pipe feature in C++ for OpenCL mode, to preserve
backwards compatibility with OpenCL C.
Various changes had to be made in Parse and Sema to enable
pipe-specific diagnostics, so enable a SemaOpenCL test for C++.
Differential Revision: https://reviews.llvm.org/D62181
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361382 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r-- | lib/Sema/SemaType.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index bd091a0691..6ba4bdcf1d 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -1356,7 +1356,7 @@ static QualType ConvertDeclSpecToType(TypeProcessingState &state) { // "At least one type specifier shall be given in the declaration // specifiers in each declaration, and in the specifier-qualifier list in // each struct declaration and type name." - if (S.getLangOpts().CPlusPlus) { + if (S.getLangOpts().CPlusPlus && !DS.isTypeSpecPipe()) { S.Diag(DeclLoc, diag::err_missing_type_specifier) << DS.getSourceRange(); @@ -1364,7 +1364,9 @@ static QualType ConvertDeclSpecToType(TypeProcessingState &state) { // value being declared, poison it as invalid so we don't get chains of // errors. declarator.setInvalidType(true); - } else if (S.getLangOpts().OpenCLVersion >= 200 && DS.isTypeSpecPipe()){ + } else if ((S.getLangOpts().OpenCLVersion >= 200 || + S.getLangOpts().OpenCLCPlusPlus) && + DS.isTypeSpecPipe()) { S.Diag(DeclLoc, diag::err_missing_actual_pipe_type) << DS.getSourceRange(); declarator.setInvalidType(true); |