kadircet added inline comments.
================
Comment at: clang/lib/Parse/ParseCXXInlineMethods.cpp:153
+ // probably truncated, so don't eat more tokens.
+ if (!Toks.back().is(tok::code_completion))
+ SkipMalformedDecl();
----------------
i don't follow the logic here. maybe i am reading the comment wrong, but we are
actually going to eat **more** tokens by calling `SkipMalformedDecl`, possibly
the following one, right? for example in a scenario like:
```
struct Foo {
Foo : ^b
int bar;
}
```
`ConsumeAndStoreFunctionPrologue` will actually put `b` following the code
completion token (`^`) into `Toks` as well, hence when we skip, we actually
skip until the next semicolon and throw away bar. But when the code completion
token is after `b`, `ConsumeAndStoreFunctionPrologue` we'll have code
completion token at the end of the `Toks` and won't skip anything
Do we have cases that break miserably when we don't perform an extra skip here
for the (possible) reminder of current initalizer?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116294/new/
https://reviews.llvm.org/D116294
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits