[Bug c/78657] Using macro with _Pragma gives error: '#pragma' is not allowed here
jquinsey at entrenet dot com
gcc-bugzilla@gcc.gnu.org
Tue Dec 6 17:16:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78657
--- Comment #2 from Joseph Quinsey <jquinsey at entrenet dot com> ---
The code
int foo =
#pragma GCC diagnostic push
42;
gives exactly the same error messages. So this report is not about _Pragma per
se, but about #pragma.
But I cannot see where or if the standard addresses this. N1570 section
5.1.1.2, Translation phases, item 4 seems to say "All preprocessing directives
are then deleted".
Other preprocessor directives on the second line, such as
int foo =
#define BAR bar
42;
are perfectly fine in gcc/g++ (including #include).
More information about the Gcc-bugs
mailing list