Implicit support for direct initialization of objects of class type, e.g.,
X x(5, 7);
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58641 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/direct-initializer.cpp b/test/SemaCXX/direct-initializer.cpp
index c756e47..952e132 100644
--- a/test/SemaCXX/direct-initializer.cpp
+++ b/test/SemaCXX/direct-initializer.cpp
@@ -8,3 +8,29 @@
int (x2)(1); // expected-warning {{statement was disambiguated as declaration}}
for (int x(1);;) {}
}
+
+class Y {
+ explicit Y(float);
+};
+
+class X { // expected-note{{candidate function}}
+public:
+ explicit X(int); // expected-note{{candidate function}}
+ X(float, float, float); // expected-note{{candidate function}}
+ X(float, Y); // expected-note{{candidate function}}
+};
+
+class Z { // expected-note{{candidate function}}
+public:
+ Z(int); // expected-note{{candidate function}}
+};
+
+void g() {
+ X x1(5);
+ X x2(1.0, 3, 4.2);
+ X x3(1.0, 1.0); // expected-error{{no matching constructor for initialization of 'x3'; candidates are:}}
+ Y y(1.0);
+ X x4(3.14, y);
+
+ Z z; // expected-error{{no matching constructor for initialization of 'z'; candidates are:}}
+}