aboutsummaryrefslogtreecommitdiff
path: root/test/CXX/special/class.inhctor/p1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CXX/special/class.inhctor/p1.cpp')
-rw-r--r--test/CXX/special/class.inhctor/p1.cpp41
1 files changed, 37 insertions, 4 deletions
diff --git a/test/CXX/special/class.inhctor/p1.cpp b/test/CXX/special/class.inhctor/p1.cpp
index 57e91504d684..8721dec1b405 100644
--- a/test/CXX/special/class.inhctor/p1.cpp
+++ b/test/CXX/special/class.inhctor/p1.cpp
@@ -2,17 +2,24 @@
// Per a core issue (no number yet), an ellipsis is always dropped.
struct A {
A(...); // expected-note {{here}}
- A(int = 0, int = 0, int = 0, int = 0, ...); // expected-note 5{{here}}
+ A(int = 0, int = 0, int = 0, int = 0, ...); // expected-note 9{{here}}
A(int = 0, int = 0, ...); // expected-note {{here}}
+
+ template<typename T> A(T, int = 0, ...); // expected-note 5{{here}}
+
+ template<typename T, int N> A(const T (&)[N]); // expected-note 2{{here}}
+ template<typename T, int N> A(const T (&)[N], int = 0); // expected-note 2{{here}}
};
-struct B : A { // expected-note 3{{candidate}}
- using A::A; // expected-warning 3{{inheriting constructor does not inherit ellipsis}} expected-note 4{{candidate}} expected-note 2{{deleted}}
+struct B : A { // expected-note 6{{candidate}}
+ using A::A; // expected-warning 4{{inheriting constructor does not inherit ellipsis}} expected-note 16{{candidate}} expected-note 3{{deleted}}
};
+struct C {} c;
+
B b0{};
// expected-error@-1 {{call to implicitly-deleted default constructor}}
-// expected-note@9 {{default constructor of 'B' is implicitly deleted because base class 'A' has multiple default constructors}}
+// expected-note@-8 {{default constructor of 'B' is implicitly deleted because base class 'A' has multiple default constructors}}
B b1{1};
// FIXME: explain why the inheriting constructor was deleted
@@ -29,3 +36,29 @@ B b4{1,2,3,4};
B b5{1,2,3,4,5};
// expected-error@-1 {{no matching constructor for initialization of 'B'}}
+
+B b6{c};
+// ok
+
+B b7{c,0};
+// ok
+
+B b8{c,0,1};
+// expected-error@-1 {{no matching constructor}}
+
+B b9{"foo"};
+// FIXME: explain why the inheriting constructor was deleted
+// expected-error@-2 {{call to deleted constructor of 'B'}}
+
+namespace PR15755 {
+ struct X {
+ template<typename...Ts> X(int, Ts...);
+ };
+ struct Y : X {
+ using X::X;
+ };
+ struct Z : Y {
+ using Y::Y;
+ };
+ Z z(0);
+}