Re: [Patch] libcpp: Fix _Pragma expansion [PR102409]

2021-10-29 Thread Tobias Burnus
Hi Martin, On 28.10.21 18:28, Martin Sebor wrote: There are a number of bug reports of _Pragma not working right in macros, including (and especially) to control diagnostics: https://gcc.gnu.org/bugzilla/buglist.cgi?quicksearch=_Pragma%20macro_id=328003 Just by the description this change

Re: [Patch] libcpp: Fix _Pragma expansion [PR102409]

2021-10-29 Thread Jakub Jelinek via Gcc-patches
On Fri, Oct 29, 2021 at 06:20:15PM +0200, Tobias Burnus wrote: > On 29.10.21 13:06, Jakub Jelinek wrote: > > On Thu, Oct 28, 2021 at 05:51:59PM +0200, Tobias Burnus wrote: > > > libcpp/ChangeLog: > > > > > > PR c++/102409 > > > * directives.c (destringize_and_run): Add PRAGMA_OP to the

Re: [Patch] libcpp: Fix _Pragma expansion [PR102409]

2021-10-29 Thread Tobias Burnus
On 29.10.21 13:06, Jakub Jelinek wrote: On Thu, Oct 28, 2021 at 05:51:59PM +0200, Tobias Burnus wrote: libcpp/ChangeLog: PR c++/102409 * directives.c (destringize_and_run): Add PRAGMA_OP to the CPP_PRAGMA token's flags to mark is as coming from _Pragma. * include/cpplib.h

Re: [Patch] libcpp: Fix _Pragma expansion [PR102409]

2021-10-29 Thread Jakub Jelinek via Gcc-patches
On Thu, Oct 28, 2021 at 05:51:59PM +0200, Tobias Burnus wrote: > libcpp/ChangeLog: > > PR c++/102409 > * directives.c (destringize_and_run): Add PRAGMA_OP to the > CPP_PRAGMA token's flags to mark is as coming from _Pragma. > * include/cpplib.h (PRAGMA_OP): #define, to be

Re: [Patch] libcpp: Fix _Pragma expansion [PR102409]

2021-10-28 Thread Martin Sebor via Gcc-patches
On 10/28/21 9:51 AM, Tobias Burnus wrote: Before this patch, running #define TEST(T) T #define PARALLEL(X) TEST(X) PARALLEL(     for (int i = 0; i < N; i++) { \   _Pragma("omp ordered") \   S[0] += C[i] + D[i]; \     }) through 'gcc -E' yielded #pragma omp ordered  for (int i =

[Patch] libcpp: Fix _Pragma expansion [PR102409]

2021-10-28 Thread Tobias Burnus
Before this patch, running #define TEST(T) T #define PARALLEL(X) TEST(X) PARALLEL( for (int i = 0; i < N; i++) { \ _Pragma("omp ordered") \ S[0] += C[i] + D[i]; \ }) through 'gcc -E' yielded #pragma omp ordered for (int i = 0; i < N; i++) { S[0] += C[i] + D[i]; } Note