From 90d4cbb87ce297d93159d39528767f5f46aa4da4 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Thu, 8 Dec 2022 21:03:42 +0300 Subject: [PATCH] [clang] Add test for CWG418 P1787: //[[ https://cplusplus.github.io/CWG/issues/418.html | CWG418 ]] is resolved by trivial rephrasing along with that necessary for the new using-declaration interpretation.// Wording: see changes to [dcl.fct.default]/9 and [over.match.best]/4. [over.match.best]/4 includes [[ https://eel.is/c++draft/over.match.best#general-example-8 | an example ]] that is not properly diagnosed by Clang. Reviewed By: #clang-language-wg, shafik Differential Revision: https://reviews.llvm.org/D139429 --- clang/test/CXX/drs/dr4xx.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ clang/www/cxx_dr_status.html | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/clang/test/CXX/drs/dr4xx.cpp b/clang/test/CXX/drs/dr4xx.cpp index 1814f5a..3617af8 100644 --- a/clang/test/CXX/drs/dr4xx.cpp +++ b/clang/test/CXX/drs/dr4xx.cpp @@ -315,6 +315,50 @@ namespace dr417 { // dr417: no } } +namespace dr418 { // dr418: no +namespace example1 { +void f1(int, int = 0); +void f1(int = 0, int); + +void g() { f1(); } +} // namespace example1 + +namespace example2 { +namespace A { +void f2(int); // #dr418-f2-decl +} +namespace B { +using A::f2; +} +namespace A { +void f2(int = 3); +} +void g2() { + using B::f2; + f2(); // expected-error {{no matching function}} + // expected-note@#dr418-f2-decl {{requires 1 argument}} +} +} // namespace example2 + +// example from [over.match.best]/4 +namespace example3 { +namespace A { +extern "C" void f(int = 5); +} +namespace B { +extern "C" void f(int = 5); +} + +using A::f; +using B::f; + +void use() { + f(3); + f(); // FIXME: this should fail +} +} // namespace example3 +} // namespace dr418 + namespace dr420 { // dr420: yes template struct ptr { T *operator->() const; diff --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html index e8cb431..1c880bab 100755 --- a/clang/www/cxx_dr_status.html +++ b/clang/www/cxx_dr_status.html @@ -2547,7 +2547,7 @@ of class templates 418 CD6 Imperfect wording on error on multiple default arguments on a called function - Unknown + No 419 -- 2.7.4