llvm-project/clang/test/Preprocessor/_Pragma-in-include.c
Stefan Weigl-Bosker 112291ad35
[clang][lex] Fix lexing malformed pragma within include directive (#138165)
this patch fixes a crash triggered by lexing past eof when emitting a
diagnostic for a malformed `_Pragma` directive within an `include`
directive.
Fixed by by preventing the lexer from eating a `tok::eod`.

Fixes #138094
2025-05-05 07:29:41 -04:00

5 lines
213 B
C

// RUN: %clang_cc1 -E %s -verify
// Don't crash, verify that diagnostics are preserved
#include _Pragma( // expected-error {{_Pragma takes a parenthesized string literal}} expected-error {{expected "FILENAME"}}