https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68954

--- Comment #5 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #3)
> Breakpoint 1, diagnostic_classify_diagnostic (
>     context=0x2467de0 <global_diagnostic_context>, option_index=213, 
>     new_kind=DK_IGNORED, where=1550920)
>     at /space/rguenther/src/svn/gcc-5-branch/gcc/diagnostic.c:633
> (gdb) p expand_location (where)
> $1 = {
>   file = 0x24e7490
> "/home/space/rguenther/install/gcc-5.3/include/c++/5.3.0/backward/binders.h",
> line = 61, column = 32, data = 0x0, sysp = true}
> 
> where context->option_enabled returns 1 and thus old_kind gets DK_ERROR
> which is not true (for whatever reason).

Your example disables the warning in the header. But the warning is actually
given at the usage point. Thus the pragma does not apply. If it was working
before, it was by chance. If you want to be able to disable the warning at the
point of declaration, then either swap the locations (warn at the declaration,
give a note at the usage point) or explicitly check the status of the warning
at the declaration point before warning. The latter will allow the pragma to be
set either at the declaration or at the usage point.

Reply via email to