https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108504
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:327d45c57ebd2655a7599df0f01b8b5e2f82eda7 commit r13-5335-g327d45c57ebd2655a7599df0f01b8b5e2f82eda7 Author: Jason Merrill <ja...@redhat.com> Date: Tue Jan 24 16:26:50 2023 -0500 c++: "" #pragma at BOF [PR108504] Since r11-2095 we pass flags to cp_lexer_get_preprocessor_token, and cp_lexer_new_main passes C_LEX_STRING_NO_JOIN when lexing most of the translation unit, but doesn't do that for the very first token; as a result, if the first token is a string literal, we try to join strings and get confused if that encounters a pragma. PR c++/108504 gcc/cp/ChangeLog: * parser.cc (cp_lexer_new_main): Pass C_LEX_STRING_NO_JOIN for first token, too. gcc/testsuite/ChangeLog: * g++.dg/ext/pragma1.C: New test.