[PATCH] D61396: [hip] Fix ambiguity from `>>>` of CUDA.

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 7 12:41:07 PDT 2019


rsmith added inline comments.


================
Comment at: clang/lib/Parse/ParseTentative.cpp:597
+                                       tok::comma)))) ||
+                (getLangOpts().CUDA && Tok.is(tok::greatergreatergreater)))) {
       TPR = TPResult::True;
----------------
No need to check for CUDA here; that's a prerequisite for forming a `greatergreatergreater` token (and if we formed that token in any other language mode, we'd still want to split it here). But this should be gated by `CPlusPlus11` for clarity, since that's where we get the "split `>>` tokens" rule from. So I think this should be:

```
    } else if (Context == TypeIdAsTemplateArgument &&
               (Tok.isOneOf(tok::greater, tok::comma) ||
                (getLangOpts().CPlusPlus11 &&
                 (Tok.isOneOf(tok::greatergreater, tok::greatergreatergreater) ||
                  (Tok.is(tok::ellipsis) &&
                   NextToken().isOneOf(tok::greater, tok::greatergreater,
                                       tok::greatergreatergreater, tok::comma)))))) {
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61396/new/

https://reviews.llvm.org/D61396





More information about the cfe-commits mailing list