Preivously we would only discard it if we failed to parse parameter lists.
If we do not consume the body, parser sees tokens inside directive. In
turn, this leads to spurious diagnostics and a crash in TokenBuffer, see
the added tests.
Details
Details
- Reviewers
sammccall - Commits
- rG18de8ea36f73: Merging r367530: --------------------------------------------------------------…
rL367681: Merging r367530:
rGb455fc429fe9: [Preprocessor] Always discard body of #define if we failed to parse it
rC367530: [Preprocessor] Always discard body of #define if we failed to parse it
rL367530: [Preprocessor] Always discard body of #define if we failed to parse it
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
LG, though I'm obviously not an expert here. Thanks for tracking this down!
clang/lib/Lex/PPDirectives.cpp | ||
---|---|---|
2405 ↗ | (On Diff #212583) | nit: "if we are still waiting for eod"? (to avoid inverting the sense) |