summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaCXX')
-rw-r--r--clang/test/SemaCXX/deleted-function.cpp2
-rw-r--r--clang/test/SemaCXX/direct-initializer.cpp14
2 files changed, 15 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/deleted-function.cpp b/clang/test/SemaCXX/deleted-function.cpp
index 8064ed349b0..637b2b1b2d5 100644
--- a/clang/test/SemaCXX/deleted-function.cpp
+++ b/clang/test/SemaCXX/deleted-function.cpp
@@ -18,7 +18,7 @@ void ov(double) = delete; // expected-note {{candidate function has been explici
struct WithDel {
WithDel() = delete; // expected-note {{candidate function has been explicitly deleted}}
void fn() = delete; // expected-note {{function has been explicitly marked deleted here}}
- operator int() = delete;
+ operator int() = delete;
void operator +(int) = delete;
int i = delete; // expected-error {{only functions can have deleted definitions}}
diff --git a/clang/test/SemaCXX/direct-initializer.cpp b/clang/test/SemaCXX/direct-initializer.cpp
index 149b65c8d71..e95ba227690 100644
--- a/clang/test/SemaCXX/direct-initializer.cpp
+++ b/clang/test/SemaCXX/direct-initializer.cpp
@@ -34,3 +34,17 @@ void g() {
Z z; // expected-error{{no matching constructor for initialization of 'z'}}
}
+
+struct Base {
+ operator int*() const; // expected-note {{candidate function}}
+};
+
+struct Derived : Base {
+ operator int*(); // expected-note {{candidate function}}
+};
+
+void foo(const Derived cd, Derived d) {
+ int *pi = cd;
+ int *ppi = d; // expected-error {{ambiguity in initializing value of type 'int *' with initializer of type 'struct Derived'}}
+
+}
OpenPOWER on IntegriCloud