]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: Implement resolution for DR 36 [PR116160]
authorNathaniel Shead <nathanieloshead@gmail.com>
Thu, 19 Sep 2024 14:47:12 +0000 (00:47 +1000)
committerNathaniel Shead <nathanieloshead@gmail.com>
Fri, 27 Sep 2024 23:00:52 +0000 (09:00 +1000)
commit2196a20b82bdde2aeb099bcfd164fa29a698e837
tree120cf7dfec42883c9d47aba40f9083ecef1a05f8
parentb9ac51a843f9dc807b00ab7f49f64968807a4ee8
c++: Implement resolution for DR 36 [PR116160]

This implements part of P1787 to no longer complain about redeclaring an
entity via using-decl other than in a class scope.

PR c++/116160

gcc/cp/ChangeLog:

* name-lookup.cc (supplement_binding): Allow redeclaration via
USING_DECL if not in class scope.
(do_nonmember_using_decl): Remove function-scope exemption.
(push_using_decl_bindings): Remove outdated comment.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/using-enum-3.C: No longer expect an error.
* g++.dg/lookup/using53.C: Remove XFAIL.
* g++.dg/cpp2a/using-enum-11.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
gcc/cp/name-lookup.cc
gcc/testsuite/g++.dg/cpp0x/using-enum-3.C
gcc/testsuite/g++.dg/cpp2a/using-enum-11.C [new file with mode: 0644]
gcc/testsuite/g++.dg/lookup/using53.C