aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authorNathaniel Shead <nathanieloshead@gmail.com>2024-04-14 23:03:11 +1000
committerNathaniel Shead <nathanieloshead@gmail.com>2024-04-30 15:01:29 +1000
commit2faf040335f9b49c33ba6d40cf317920f27ce431 (patch)
tree263e5c9f592bd1f1e726d472878e5d2cc6cff843 /libcpp
parent22b20ac6c6aead2d3f36c413a77dd0b80adfec39 (diff)
downloadgcc-2faf040335f9b49c33ba6d40cf317920f27ce431.zip
gcc-2faf040335f9b49c33ba6d40cf317920f27ce431.tar.gz
gcc-2faf040335f9b49c33ba6d40cf317920f27ce431.tar.bz2
c++: Standardise errors for module_may_redeclare
Currently different places calling 'module_may_redeclare' all emit very similar but slightly different error messages, and handle different kinds of declarations differently. This patch makes the function perform its own error messages so that they're all in one place, and prepares it for use with temploid friends. gcc/cp/ChangeLog: * cp-tree.h (module_may_redeclare): Add default parameter. * decl.cc (duplicate_decls): Don't emit errors for failed module_may_redeclare. (xref_tag): Likewise. (start_enum): Likewise. * semantics.cc (begin_class_definition): Likewise. * module.cc (module_may_redeclare): Clean up logic. Emit error messages on failure. gcc/testsuite/ChangeLog: * g++.dg/modules/enum-12.C: Update error message. * g++.dg/modules/friend-5_b.C: Likewise. * g++.dg/modules/shadow-1_b.C: Likewise. Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com> Reviewed-by: Jason Merrill <jason@redhat.com>
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions