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

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Nathaniel Shead <nsh...@gcc.gnu.org>:

https://gcc.gnu.org/g:10418a6cbd34e0a4081f6dcdf8c36a9592aaf318

commit r16-3433-g10418a6cbd34e0a4081f6dcdf8c36a9592aaf318
Author: Nathaniel Shead <nathanielosh...@gmail.com>
Date:   Wed Aug 27 22:24:43 2025 +1000

    c++/modules: Add explanatory note for incomplete types with definition in
different module [PR119844]

    The confusion in the PR arose because the definition of 'User' in a
    separate named module did not provide an implementation for the
    forward-declaration in the global module.  This seems likely to be a
    common mistake while people are transitioning to modules, so this patch
    adds an explanatory note.

    While I was looking at this I also noticed that the existing handling of
    partial specialisations for this note was wrong (we pointed at the
    primary template declaration rather than the relevant partial spec), so
    this patch fixes that up, and also gives a more precise error message
    for using a template other than by self-reference while it's being
    defined.

            PR c++/119844

    gcc/cp/ChangeLog:

            * typeck2.cc (cxx_incomplete_type_inform): Add explanation when
            a similar type is complete but attached to a different module.
            Also fix handling of partial specs and templates.

    gcc/testsuite/ChangeLog:

            * g++.dg/modules/pr119844_a.C: New test.
            * g++.dg/modules/pr119844_b.C: New test.

    Signed-off-by: Nathaniel Shead <nathanielosh...@gmail.com>
  • [Bug c++/119844] Incomplete typ... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to