llvm-project
4122ec64 - [clang][Lex] Skip to the end of directive after diagnosing 'defined' in an #embed parameter (#235934)

Commit
39 days ago
[clang][Lex] Skip to the end of directive after diagnosing 'defined' in an #embed parameter (#235934) The `EvaluatedDefined` error path in `LexEmbedParameters` returned without discarding the rest of the directive, the only error path in the function that didn't. With any token following the parameter's closing paren, e.g. #embed <f> limit(defined(x)), `HandleEmbedDirective` hit its "expected success or to be at the end of the directive" assertion (a no-assert build would resume lexing mid-directive). Discard the remaining tokens like the neighboring error paths do, and add coverage for both the `#embed` and `__has_embed` forms. Fixes #212075
Author
Parents
Loading