summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard@metafoo.co.uk>2019-11-20 11:58:34 -0800
committerRichard Smith <richard@metafoo.co.uk>2019-11-20 11:59:58 -0800
commitfd8d9155a997ab0f3ef3d7dff1c56efc9b692bfe (patch)
tree80fde7354072c82ec0d953b92bce39406b957d73 /clang/lib/Parse/ParseDecl.cpp
parent6de45772e0910bf7fa626e5493a2798b071eb26c (diff)
downloadbcm5719-llvm-fd8d9155a997ab0f3ef3d7dff1c56efc9b692bfe.tar.gz
bcm5719-llvm-fd8d9155a997ab0f3ef3d7dff1c56efc9b692bfe.zip
Fix parser bug that permitted 'private' as a (no-op) decl-specifier even outside OpenCL.
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index e5c17a3131a..a90147ca469 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -3949,9 +3949,14 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
PrevSpec = Tok.getIdentifierInfo()->getNameStart();
isInvalid = true;
break;
- };
+ }
LLVM_FALLTHROUGH;
case tok::kw_private:
+ // It's fine (but redundant) to check this for __generic on the
+ // fallthrough path; we only form the __generic token in OpenCL mode.
+ if (!getLangOpts().OpenCL)
+ goto DoneWithDeclSpec;
+ LLVM_FALLTHROUGH;
case tok::kw___private:
case tok::kw___global:
case tok::kw___local:
OpenPOWER on IntegriCloud