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

--- Comment #4 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:a7135aaa4e6faae357b5997260d64208d67a7c3b

commit r16-8165-ga7135aaa4e6faae357b5997260d64208d67a7c3b
Author: Nathaniel Shead <[email protected]>
Date:   Fri Mar 13 17:31:52 2026 +1100

    libcpp: Handle macro locations in linemap_location_from_module_p [PR124466]

    The testcase crashed because in warn-spec-5_b.C we were writing
    diagnostic classifications for pops but not for the things they were
    ignoring.  We should have been writing neither, as they all came from an
    imported location, but linemap_location_from_module_p was returning
    false for locations that originated from macros in a module.

            PR c++/124466

    libcpp/ChangeLog:

            * line-map.cc (linemap_location_from_module_p): Resolve loc in
            case it's a macro location.

    gcc/testsuite/ChangeLog:

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

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

Reply via email to