Any comments on this? https://gcc.gnu.org/ml/gcc-patches/2015-07/msg02414.html

I don't see any other way to fix these PRs, but I don't know how to
keep the pragmas from being deleted by the preprocessor.

Cheers,

Manuel.

On 29 July 2015 at 00:46, Manuel López-Ibáñez <lopeziba...@gmail.com> wrote:
> Currently, #pragma GCC diagnostic is handled entirely by the FE. This
> has several drawbacks:
>
> * PR c++/53431 - C++ preprocessor ignores #pragma GCC diagnostic: The
> C++ parser lexes (and preprocesses) before handling the pragmas.
>
> * PR 53920 - "gcc -E" does not honor #pragma GCC diagnostic ignored
> "-Wunused-macro": Because -E does not invoke the FE code that parses
> the FE pragmas.
>
> * PR 64698 - preprocessor ignores #pragma GCC diagnostic when using
> -save-temps. Same issue as above.
>
> The following patch moves the handling of #pragma GCC diagnostic to
> libcpp but keeps the interface with the diagnostic machinery in the FE
> by using a call-back function.
>
> One serious problem with this approach is that the preprocessor will
> delete the pragmas from the preprocessed output, thus '-E',
> '-save-temps'  will not contain the pragmas and compiling the
> preprocessed file will trigger the warnings that they were meant to
> suppress.  Any ideas how to prevent libcpp from deleting the #pragmas?
>
> No Changelog since this is not a request for approval, but comments are 
> welcome.
>
> Cheers,
>
> Manuel.

Reply via email to