[clang] [Clang] CWG2789 Overload resolution with implicit and explicit object… (PR #73493)
Vlad Serebrennikov via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 27 09:20:15 PST 2023
================
@@ -0,0 +1,31 @@
+// RUN: %clang_cc1 -std=c++2c -verify %s
+
+
+namespace dr2789 { // dr2789: 18 open
+
+template <typename T = int>
+struct Base {
+ constexpr void g(); // expected-note {{candidate function}}
+};
+
+template <typename T = int>
+struct Base2 {
+ constexpr void g() requires true; // expected-note {{candidate function}}
+};
+
+template <typename T = int>
+struct S : Base<T>, Base2<T> {
+ constexpr void f(); // #1
+ constexpr void f(this S&) requires true{}; // #2
+
+ using Base<T>::g;
+ using Base2<T>::g;
+};
+
+void test() {
+ S<> s;
+ s.f();
+ s.g(); // expected-error {{call to member function 'g' is ambiguous}}
----------------
Endilll wrote:
I believe our current best practices on handling errors with notes in DR tests are showcased here: https://github.com/llvm/llvm-project/blob/fe3c4218438adeebba4914a57b4d382e3a947394/clang/test/CXX/drs/dr13xx.cpp#L505
Notes being scattered across the test makes it harder to match the test against compiler output on e.g. Compiler Explorer.
https://github.com/llvm/llvm-project/pull/73493
More information about the cfe-commits
mailing list