summaryrefslogtreecommitdiff
path: root/test/CXX/special/class.inhctor/p7.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CXX/special/class.inhctor/p7.cpp')
-rw-r--r--test/CXX/special/class.inhctor/p7.cpp49
1 files changed, 25 insertions, 24 deletions
diff --git a/test/CXX/special/class.inhctor/p7.cpp b/test/CXX/special/class.inhctor/p7.cpp
index a57e8558f5cbb..c22a43a618987 100644
--- a/test/CXX/special/class.inhctor/p7.cpp
+++ b/test/CXX/special/class.inhctor/p7.cpp
@@ -1,47 +1,48 @@
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+//
+// Note: [class.inhctor] was removed by P0136R1. This tests the new behavior
+// for the wording that used to be there.
-// Straight from the standard
-struct B1 {
- B1(int); // expected-note {{previous constructor}} expected-note {{conflicting constructor}}
+struct B1 { // expected-note 2{{candidate}}
+ B1(int); // expected-note {{candidate}}
};
-struct B2 {
- B2(int); // expected-note {{conflicting constructor}}
+struct B2 { // expected-note 2{{candidate}}
+ B2(int); // expected-note {{candidate}}
};
-struct D1 : B1, B2 {
- using B1::B1; // expected-note {{inherited here}}
- using B2::B2; // expected-error {{already inherited constructor with the same signature}}
+struct D1 : B1, B2 { // expected-note 2{{candidate}}
+ using B1::B1; // expected-note 3{{inherited here}}
+ using B2::B2; // expected-note 3{{inherited here}}
};
struct D2 : B1, B2 {
using B1::B1;
using B2::B2;
D2(int);
};
+D1 d1(0); // expected-error {{ambiguous}}
+D2 d2(0);
template<typename T> struct B3 {
- B3(T); // expected-note {{previous constructor}}
+ B3(T);
};
template<typename T> struct B4 : B3<T>, B1 {
B4();
- using B3<T>::B3; // expected-note {{inherited here}}
- using B1::B1; // expected-error {{already inherited}}
+ using B3<T>::B3;
+ using B1::B1;
};
B4<char> b4c;
-B4<int> b4i; // expected-note {{here}}
+B4<int> b4i;
struct B5 {
- template<typename T> B5(T); // expected-note {{previous constructor}}
-};
-struct B6 {
- template<typename T> B6(T); // expected-note {{conflicting constructor}}
+ template<typename T> B5(T);
};
-struct B7 {
- template<typename T, int> B7(T);
-};
-struct D56 : B5, B6, B7 {
- using B5::B5; // expected-note {{inherited here}}
- using B6::B6; // expected-error {{already inherited}}
+struct D6 : B5 {
+ using B5::B5;
+ template<typename T> D6(T);
};
-struct D57 : B5, B6, B7 {
+D6 d6(0);
+struct D7 : B5 {
using B5::B5;
- using B7::B7; // ok, not the same signature
+ template<typename T> D7(T, ...);
};
+// DRxxx (no number yet): derived class ctor beats base class ctor.
+D7 d7(0);