gcc/libcpp
Jakub Jelinek a6e0d59370 libcpp: Fix _Pragma stringification [PR103165]
As the testcase show, sometimes _Pragma is turned into CPP_PRAGMA
.. CPP_PRAGMA_EOL tokens, even when it might still need to be
stringized later on.  We are then ICEing because we don't handle
stringification of CPP_PRAGMA or CPP_PRAGMA_EOL, but trying to
reconstruct the exact tokens with exact spacing after it has been
lowered is very hard.  So, instead this patch ensures we don't
lower _Pragma during expand_arg calls, but only later when
cpp_get_token_1 is called outside of expand_arg.

2021-11-22  Jakub Jelinek  <jakub@redhat.com>
	    Tobias Burnus  <tobias@codesourcery.com>

	PR preprocessor/103165
libcpp/
	* internal.h (struct lexer_state): Add ignore__Pragma field.
	* macro.c (builtin_macro): Don't interpret _Pragma if
	pfile->state.ignore__Pragma.
	(expand_arg): Temporarily set pfile->state.ignore__Pragma to 1.
gcc/testsuite/
	* c-c++-common/gomp/pragma-3.c: New test.
	* c-c++-common/gomp/pragma-4.c: New test.
	* c-c++-common/gomp/pragma-5.c: New test.

Co-Authored-By: Tobias Burnus <tobias@codesourcery.com>
2021-11-22 22:29:20 +01:00
..
include libcpp: Implement -Wbidi-chars for CVE-2021-42574 [PR103026] 2021-11-16 21:56:16 -05:00
po Daily bump. 2021-08-17 00:16:32 +00:00
ChangeLog Daily bump. 2021-11-18 00:16:34 +00:00
ChangeLog.jit Merger of dmalcolm/jit branch from git 2014-11-11 21:55:52 +00:00
Makefile.in Add install-dvi Makefile targets. 2021-10-22 15:43:50 -07:00
aclocal.m4 libcpp: Enable Intel CET on Intel CET enabled host for jit 2020-05-12 09:17:45 -07:00
charset.c diagnostics: escape non-ASCII source bytes for certain diagnostics 2021-11-01 09:35:46 -04:00
config.in Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
configure GCC_CET_HOST_FLAGS: Check if host supports multi-byte NOPs 2021-05-03 05:01:23 -07:00
configure.ac libcpp, libdecnumber: configure and substitute AR 2020-05-23 21:59:02 +00:00
directives.c libcpp: Fix _Pragma expansion [PR102409] 2021-10-29 22:55:32 +02:00
errors.c diagnostics: escape non-ASCII source bytes for certain diagnostics 2021-11-01 09:35:46 -04:00
expr.c preprocessor: Fix pp-number lexing of digit separators [PR83873, PR97604] 2021-05-06 23:20:35 +00:00
files.c diagnostics: Support for -finput-charset [PR93067] 2021-08-25 11:15:28 -04:00
generated_cpp_wcwidth.h libcpp: Update cpp_wcwidth() to Unicode 13.0.0 2020-11-07 09:36:43 -05:00
identifiers.c Update copyright years. 2021-01-04 10:26:59 +01:00
init.c libcpp: Implement -Wbidi-chars for CVE-2021-42574 [PR103026] 2021-11-16 21:56:16 -05:00
internal.h libcpp: Fix _Pragma stringification [PR103165] 2021-11-22 22:29:20 +01:00
lex.c libcpp: capture and underline ranges in -Wbidi-chars= [PR103026] 2021-11-17 17:34:12 -05:00
line-map.c diagnostics: escape non-ASCII source bytes for certain diagnostics 2021-11-01 09:35:46 -04:00
location-example.txt PR preprocessor/83173: Enhance -fdump-internal-locations output 2018-11-27 16:04:31 +00:00
macro.c libcpp: Fix _Pragma stringification [PR103165] 2021-11-22 22:29:20 +01:00
makeucnid.c libcpp: Implement C++23 P1949R7 - C++ Identifier Syntax using Unicode Standard Annex 31 2021-09-01 22:33:06 +02:00
mkdeps.c preprocessor: Make quoting : [PR 95253] 2021-01-15 08:56:20 -08:00
pch.c Update copyright years. 2021-01-04 10:26:59 +01:00
symtab.c Update copyright years. 2021-01-04 10:26:59 +01:00
system.h Update copyright years. 2021-01-04 10:26:59 +01:00
traditional.c Update copyright years. 2021-01-04 10:26:59 +01:00
ucnid.h libcpp: Implement C++23 P1949R7 - C++ Identifier Syntax using Unicode Standard Annex 31 2021-09-01 22:33:06 +02:00
ucnid.tab Update copyright years. 2021-01-04 10:26:59 +01:00