diff options
| author | Aaron Ballman <aaron@aaronballman.com> | 2024-09-16 07:46:58 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-16 07:46:58 -0400 |
| commit | 1881f648e28aa58aa0a4dca1422572f65dafa9a4 (patch) | |
| tree | db61480c547adefdb8d7fc468f1fa1a6050f491c /llvm/lib/Transforms/Utils/SimplifyCFG.cpp | |
| parent | 5aaf384b1614fcef5504d0b16d3e5063f72943c1 (diff) | |
| download | llvm-1881f648e28aa58aa0a4dca1422572f65dafa9a4.zip llvm-1881f648e28aa58aa0a4dca1422572f65dafa9a4.tar.gz llvm-1881f648e28aa58aa0a4dca1422572f65dafa9a4.tar.bz2 | |
Remove ^^ as a token in OpenCL (#108224)
OpenCL has a reserved operator (^^), the use of which was diagnosed as
an error (735c6cdebdcd4292928079cb18a90f0dd5cd65fb). However, OpenCL
also encourages working with the blocks language extension. This token
has a parsing ambiguity as a result. Consider:
unsigned x=0;
unsigned y=x^^{return 0;}();
This should result in y holding the value zero (0^0) through an
immediately invoked block call as the right-hand side of the xor
operator. However, it causes errors instead because of this reserved
token: https://godbolt.org/z/navf7jTv1
This token is still reserved in OpenCL 3.0, so we still wish to issue a
diagnostic for its use. However, we do not need to create a token for an
extension point that's been unused for about a decade. So this patch
moves the diagnostic from a parsing diagnostic to a lexing diagnostic
and no longer forms a single token. The diagnostic behavior is slightly
worse as a result, but still seems acceptable.
Part of the reason this is coming up is because WG21 is considering
using ^^ as a token for reflection, so this token may come back in the
future.
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyCFG.cpp')
0 files changed, 0 insertions, 0 deletions
