gcc/libcpp
Jakub Jelinek 170c850e4b libcpp: Fix up pragma preprocessing [PR100450]
Since the r0-85991-ga25a8f3be322fe0f838947b679f73d6efc2a412c
https://gcc.gnu.org/legacy-ml/gcc-patches/2008-02/msg01329.html
changes, so that we handle macros inside of pragmas that should expand
macros, during preprocessing we print those pragmas token by token,
with CPP_PRAGMA printed as
      fputs ("#pragma ", print.outf);
      if (space)
        fprintf (print.outf, "%s %s", space, name);
      else
        fprintf (print.outf, "%s", name);
where name is some identifier (so e.g. print
 #pragma omp parallel
or
 #pragma omp for
etc.).  Because it ends in an identifier, we need to handle it like
an identifier (i.e. CPP_NAME) for the decision whether a space needs
to be emitted in between that #pragma whatever or #pragma whatever whatever
and following token, otherwise the attached testcase is preprocessed as
 #pragma omp forreduction(+:red)
rather than
 #pragma omp for reduction(+:red)
The cpp_avoid_paste function is only called for this purpose.

2021-05-07  Jakub Jelinek  <jakub@redhat.com>

	PR c/100450
	* lex.c (cpp_avoid_paste): Handle token1 CPP_PRAGMA like CPP_NAME.

	* c-c++-common/gomp/pr100450.c: New test.
2021-05-07 17:48:37 +02:00
..
include Fix thinko in libcpp preparation patch for modules 2021-04-13 11:57:55 +02:00
po Daily bump. 2021-03-30 00:16:29 +00:00
aclocal.m4
ChangeLog Daily bump. 2021-05-07 00:16:33 +00:00
ChangeLog.jit
charset.c Update copyright years. 2021-01-04 10:26:59 +01:00
config.in
configure GCC_CET_HOST_FLAGS: Check if host supports multi-byte NOPs 2021-05-03 05:01:23 -07:00
configure.ac
directives.c preprocessor: Handle digit separators in #line [PR82359] 2021-04-29 19:50:47 +00:00
errors.c Update copyright years. 2021-01-04 10:26:59 +01:00
expr.c preprocessor: Fix pp-number lexing of digit separators [PR83873, PR97604] 2021-05-06 23:20:35 +00:00
files.c c++: header-unit build capability [PR 99023] 2021-02-18 13:22:48 -08:00
generated_cpp_wcwidth.h
identifiers.c Update copyright years. 2021-01-04 10:26:59 +01:00
init.c c++: modules & -fpreprocessed [PR 99072] 2021-02-24 09:14:34 -08:00
internal.h c++: header-unit build capability [PR 99023] 2021-02-18 13:22:48 -08:00
lex.c libcpp: Fix up pragma preprocessing [PR100450] 2021-05-07 17:48:37 +02:00
line-map.c preprocessor/100142 - revert unwanted change in last commit 2021-04-19 14:43:39 +02:00
location-example.txt
macro.c c++: header-unit build capability [PR 99023] 2021-02-18 13:22:48 -08:00
Makefile.in Update copyright years. 2021-01-04 10:26:59 +01:00
makeucnid.c Update copyright years. 2021-01-04 10:26:59 +01: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 Update copyright years. 2021-01-04 10:26:59 +01:00
ucnid.tab Update copyright years. 2021-01-04 10:26:59 +01:00