diff options
author | Nathaniel Shead <nathanieloshead@gmail.com> | 2024-07-05 13:52:01 +1000 |
---|---|---|
committer | Nathaniel Shead <nathanieloshead@gmail.com> | 2024-07-12 22:47:30 +1000 |
commit | 1f7a21c6e85d553e7b5114e5ca1395118478dddf (patch) | |
tree | 197b272814e2610799b032cfaec7fb6688ad2bbe /libcpp/include | |
parent | d6bf4b1c93221118b3008a878ec508f6412dfc55 (diff) | |
download | gcc-1f7a21c6e85d553e7b5114e5ca1395118478dddf.zip gcc-1f7a21c6e85d553e7b5114e5ca1395118478dddf.tar.gz gcc-1f7a21c6e85d553e7b5114e5ca1395118478dddf.tar.bz2 |
c++/modules: Handle redefinitions of using-decls
This fixes an ICE exposed by supporting exported non-function
using-decls. Sometimes when preparing to define a class, xref_tag will
find a using-decl belonging to a different namespace, which triggers the
checking_assert in modules handling.
Ideally I feel that 'lookup_and_check_tag' should be told whether we're
about to define the type and handle erroring on redefinitions itself to
avoid this issue (and provide better diagnostics by acknowledging the
using-declaration), but this is complicated with the current
fragmentation of definition checking. So for this patch we just fixup
the assertion and ensure that pushdecl properly errors on the
conflicting declaration later.
gcc/cp/ChangeLog:
* decl.cc (xref_tag): Move assertion into condition.
* name-lookup.cc (check_module_override): Check for conflicting
types and using-decls.
gcc/testsuite/ChangeLog:
* g++.dg/modules/using-19_a.C: New test.
* g++.dg/modules/using-19_b.C: New test.
Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Diffstat (limited to 'libcpp/include')
0 files changed, 0 insertions, 0 deletions