[clang] [clang] fix the unexpected control flow in ParseTentative.cpp (PR #109298)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 20 21:49:00 PDT 2024


tbaederr wrote:

Yeah the behavior is not the same. The original code only parsed `ident[,]` in the loop, since the `continue` ended the loop anyway.

The comment above the function reads:
```
/// [ObjC] protocol-qualifiers:
////         '<' identifier-list '>'
```

So the assumption is that this should parse multiple identifiers, and not just one. I think the new code does that.

I'm only worried about the missing return at the end of the function - maybe there should be a `llvm_unreachable` here to silence compilers, even if that control flow is not possible.

https://github.com/llvm/llvm-project/pull/109298


More information about the cfe-commits mailing list