summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/overload-call.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/overload-call.cpp')
-rw-r--r--test/SemaCXX/overload-call.cpp33
1 files changed, 30 insertions, 3 deletions
diff --git a/test/SemaCXX/overload-call.cpp b/test/SemaCXX/overload-call.cpp
index e2a4fd8..77e0908 100644
--- a/test/SemaCXX/overload-call.cpp
+++ b/test/SemaCXX/overload-call.cpp
@@ -53,7 +53,7 @@ int* k(char*);
double* k(bool);
void test_k() {
- int* ip1 = k("foo");
+ int* ip1 = k("foo"); // expected-warning{{conversion from string literal to 'char *' is deprecated}}
double* dp1 = k(L"foo");
}
@@ -61,7 +61,7 @@ int* l(wchar_t*);
double* l(bool);
void test_l() {
- int* ip1 = l(L"foo");
+ int* ip1 = l(L"foo"); // expected-warning{{conversion from string literal to 'wchar_t *' is deprecated}}
double* dp1 = l("foo");
}
@@ -79,7 +79,7 @@ class E;
void test_n(E* e) {
char ca[7];
int* ip1 = n(ca);
- int* ip2 = n("foo");
+ int* ip2 = n("foo"); // expected-warning{{conversion from string literal to 'char *' is deprecated}}
float fa[7];
double* dp1 = n(fa);
@@ -359,3 +359,30 @@ namespace DerivedToBaseVsVoid {
int &ir = f(b);
}
}
+
+// PR 6398 + PR 6421
+namespace test4 {
+ class A;
+ class B {
+ static void foo(); // expected-note {{not viable}}
+ static void foo(int*); // expected-note {{not viable}}
+ static void foo(long*); // expected-note {{not viable}}
+
+ void bar(A *a) {
+ foo(a); // expected-error {{no matching function for call}}
+ }
+ };
+}
+
+namespace DerivedToBase {
+ struct A { };
+ struct B : A { };
+ struct C : B { };
+
+ int &f0(const A&);
+ float &f0(B);
+
+ void g() {
+ float &fr = f0(C());
+ }
+}
OpenPOWER on IntegriCloud