https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127403
Waffl3x <waffl3x at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |waffl3x at gcc dot gnu.org
--- Comment #2 from Waffl3x <waffl3x at gcc dot gnu.org> ---
(In reply to Drea Pinski from comment #1)
> I think it is wrong in C mode.
What about it? It appears to return the value in the stmt-expr in C
just fine. Do you mean that the pragma should also cause the same
problem in C? Ah... I see what you're saying in PR122050.
In my opinion, the C and C++ standards are clear that a pragma is not a
statement, (except for #pragma STDC which C makes a specific exception
for). Unfortunately I know we have some pragmas that -are- effectively
statements. My opinion is that such pragmas insert statements, but the
pragma itself is not a statement. A pragma like GCC diagnostic pop
should not insert a statement.
I would say we can close this as a dupe of PR63326, not of PR122050. I
agree that stmt-expr in C is wrong, but I disagree that 'GCC diagnostic
pop' should introduce a statement.