- For template arguments ending with >>>, we should cease lookahead and treat it as type-id firstly, so that deduction could work properly.
Details
Details
- Reviewers
tra yaxunl rsmith - Commits
- rZORGbd997ac57807: [hip] Fix ambiguity from `>>>` of CUDA.
rZORG2af9174e5c2a: [hip] Fix ambiguity from `>>>` of CUDA.
rGbd997ac57807: [hip] Fix ambiguity from `>>>` of CUDA.
rG2af9174e5c2a: [hip] Fix ambiguity from `>>>` of CUDA.
rG0fb707b93b93: [hip] Fix ambiguity from `>>>` of CUDA.
rC360214: [hip] Fix ambiguity from `>>>` of CUDA.
rL360214: [hip] Fix ambiguity from `>>>` of CUDA.
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
clang/lib/Parse/ParseTentative.cpp | ||
---|---|---|
597 ↗ | (On Diff #197624) | 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)))))) { |
clang/lib/Parse/ParseTentative.cpp | ||
---|---|---|
597 ↗ | (On Diff #198529) | A test for this case would be nice. Eg: template<typename ...T> void bar() { S<S<S<T()...>>> s; } |