]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: repeated export using
authorJason Merrill <jason@redhat.com>
Wed, 12 Jun 2024 12:06:47 +0000 (08:06 -0400)
committerJason Merrill <jason@redhat.com>
Wed, 12 Jun 2024 20:30:42 +0000 (16:30 -0400)
commit074c1fc797435979c00b24aff2a4f895b8273bcf
tree113137380835b869f8d748bec1171d2af5ff9ae8
parentf8356d66cfbda1e65536016d3049342a43f6af63
c++: repeated export using

A sample implementation of module std was breaking because the exports
included 'using std::operator&' twice.  Since Nathaniel's r15-964 for
PR114867, the first using added an extra instance of each function that was
revealed/exported by that using, resulting in duplicates for
lookup_maybe_add to dedup.  But if the duplicate is the first thing in the
list, lookup_add doesn't make an OVERLOAD, so trying to set OVL_USING_P
crashes.  Fixed by using ovl_make in the case where we want to set the flag.

gcc/cp/ChangeLog:

* tree.cc (lookup_maybe_add): Use ovl_make when setting OVL_USING_P.

gcc/testsuite/ChangeLog:

* g++.dg/modules/using-21_a.C: New test.
gcc/cp/tree.cc
gcc/testsuite/g++.dg/modules/using-21_a.C [new file with mode: 0644]