aboutsummaryrefslogtreecommitdiff
path: root/gcc/config.gcc
diff options
context:
space:
mode:
authorNathaniel Shead <nathanieloshead@gmail.com>2024-08-12 10:57:39 +1000
committerNathaniel Shead <nathanieloshead@gmail.com>2024-11-05 11:33:42 +1100
commita96c774f7bb99729ab9e7e2a57cd970469ccbc08 (patch)
tree458e47dfe9d468dd919f97c10216bfcc34ece5e2 /gcc/config.gcc
parent48ef485eabc8fd3e16d184860ce693816f3919eb (diff)
downloadgcc-a96c774f7bb99729ab9e7e2a57cd970469ccbc08.zip
gcc-a96c774f7bb99729ab9e7e2a57cd970469ccbc08.tar.gz
gcc-a96c774f7bb99729ab9e7e2a57cd970469ccbc08.tar.bz2
c++/modules: Merge default arguments [PR99274]
When merging a newly imported declaration with an existing declaration we don't currently propagate new default arguments, which causes issues when modularising header units. This patch adds logic to propagate default arguments to existing declarations on import, and error if the defaults do not match. PR c++/99274 gcc/cp/ChangeLog: * module.cc (trees_in::is_matching_decl): Merge default arguments. * tree.cc (cp_tree_equal) <AGGR_INIT_EXPR>: Handle unification of AGGR_INIT_EXPRs with new VAR_DECL slots. gcc/testsuite/ChangeLog: * g++.dg/modules/lambda-7.h: Skip ODR-violating declaration when testing ODR deduplication. * g++.dg/modules/lambda-7_b.C: Note we're testing ODR deduplication. * g++.dg/modules/default-arg-1_a.H: New test. * g++.dg/modules/default-arg-1_b.C: New test. * g++.dg/modules/default-arg-2_a.H: New test. * g++.dg/modules/default-arg-2_b.C: New test. * g++.dg/modules/default-arg-3.h: New test. * g++.dg/modules/default-arg-3_a.H: New test. * g++.dg/modules/default-arg-3_b.C: New test. Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com> Reviewed-by: Patrick Palka <ppalka@redhat.com> Reviewed-by: Jason Merrill <jason@redhat.com>
Diffstat (limited to 'gcc/config.gcc')
0 files changed, 0 insertions, 0 deletions