aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorAnastasia Stulova <anastasia.stulova@arm.com>2021-05-04 14:17:40 +0100
committerAnastasia Stulova <anastasia.stulova@arm.com>2021-05-04 14:30:42 +0100
commit64911eec75bb0c54e40665a2c3f744f046c66a59 (patch)
tree5fbd7acd91fd8f39161129be9018d5b0ad9c5d8a /clang/lib/Parse/ParseDecl.cpp
parent00895831ab23f4de2713a6ad529ba48773d067c1 (diff)
downloadllvm-64911eec75bb0c54e40665a2c3f744f046c66a59.zip
llvm-64911eec75bb0c54e40665a2c3f744f046c66a59.tar.gz
llvm-64911eec75bb0c54e40665a2c3f744f046c66a59.tar.bz2
[OpenCL] Allow pipe as a valid identifier prior to OpenCL 2.0.
Pipe has not been a reserved keyword in the earlier OpenCL standards. However we failed to allow its use as an identifier in the original commit. This issues is fixed now and testing is improved accordingly. Differential Revision: https://reviews.llvm.org/D101052
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index eb567f5..b56f393 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -3930,6 +3930,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
// OpenCL 2.0 and later define this keyword. OpenCL 1.2 and earlier
// should support the "pipe" word as identifier.
Tok.getIdentifierInfo()->revertTokenIDToIdentifier();
+ Tok.setKind(tok::identifier);
goto DoneWithDeclSpec;
}
isInvalid = DS.SetTypePipe(true, Loc, PrevSpec, DiagID, Policy);