aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorAnastasia Stulova <anastasia.stulova@arm.com>2019-02-15 12:07:57 +0000
committerAnastasia Stulova <anastasia.stulova@arm.com>2019-02-15 12:07:57 +0000
commit2c4730ded83a4cb4abe01781af415c4667569666 (patch)
tree0a9d71ab780cefd0d2957e128da1219a8abe2ef8 /clang/lib/Parse/ParseDecl.cpp
parent302f300a7a705e0bf27ee1987ec263b929ee92a5 (diff)
downloadllvm-2c4730ded83a4cb4abe01781af415c4667569666.zip
llvm-2c4730ded83a4cb4abe01781af415c4667569666.tar.gz
llvm-2c4730ded83a4cb4abe01781af415c4667569666.tar.bz2
[OpenCL][PR40707] Allow OpenCL C types in C++ mode.
Allow all OpenCL types to be parsed in C++ mode. llvm-svn: 354121
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index a3080e6..882972d 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -3809,19 +3809,6 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
getLangOpts());
break;
- // OpenCL access qualifiers:
- case tok::kw___read_only:
- case tok::kw___write_only:
- case tok::kw___read_write:
- // OpenCL C++ 1.0 s2.2: access qualifiers are reserved keywords.
- if (Actions.getLangOpts().OpenCLCPlusPlus) {
- DiagID = diag::err_openclcxx_reserved;
- PrevSpec = Tok.getIdentifierInfo()->getNameStart();
- isInvalid = true;
- }
- ParseOpenCLQualifiers(DS.getAttributes());
- break;
-
// OpenCL address space qualifiers:
case tok::kw___generic:
// generic address space is introduced only in OpenCL v2.0
@@ -3838,6 +3825,10 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
case tok::kw___global:
case tok::kw___local:
case tok::kw___constant:
+ // OpenCL access qualifiers:
+ case tok::kw___read_only:
+ case tok::kw___write_only:
+ case tok::kw___read_write:
ParseOpenCLQualifiers(DS.getAttributes());
break;