[PR41247] Fixed parsing of private keyword in C++.
Fixed bug in C++ to prevent parsing 'private' as a
valid address space qualifier.
Differential Revision: https://reviews.llvm.org/D59874
llvm-svn: 357162
diff --git a/clang/lib/Parse/ParseTentative.cpp b/clang/lib/Parse/ParseTentative.cpp
index d0549a9..46366ff 100644
--- a/clang/lib/Parse/ParseTentative.cpp
+++ b/clang/lib/Parse/ParseTentative.cpp
@@ -1414,8 +1414,13 @@
// cv-qualifier
case tok::kw_const:
case tok::kw_volatile:
+ return TPResult::True;
+
// OpenCL address space qualifiers
case tok::kw_private:
+ if (!getLangOpts().OpenCL)
+ return TPResult::False;
+ LLVM_FALLTHROUGH;
case tok::kw___private:
case tok::kw___local:
case tok::kw___global: