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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Nathaniel Shead <[email protected]>:

https://gcc.gnu.org/g:0661c5480c80bc40d9bc1cb15c3264d67c2efe9c

commit r16-8045-g0661c5480c80bc40d9bc1cb15c3264d67c2efe9c
Author: Nathaniel Shead <[email protected]>
Date:   Fri Mar 13 00:47:36 2026 +1100

    c++/modules: Support diagnostic classification changes in macros [PR124459]

    Diagnostic classification changes via _Pragma can occur in macros, but
    weren't taking effect in imported modules.  The issue is that we were
    reading the diagnostic classification map before we processed the macro
    maps, which meant that all locations in macros were just falling back
    to the abstract location of the module itself.  Fixed by moving the
    processing after we've read the macro maps.

            PR c++/124459

    gcc/cp/ChangeLog:

            * module.cc (module_state::read_initial): Move
            read_diagnostic_classification after read_macro_maps.

    gcc/testsuite/ChangeLog:

            * g++.dg/modules/warn-spec-4_a.C: New test.
            * g++.dg/modules/warn-spec-4_b.C: New test.

    Signed-off-by: Nathaniel Shead <[email protected]>
    Reviewed-by: Jason Merrill <[email protected]>

Reply via email to