summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/cxx11-inheriting-ctors.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/cxx11-inheriting-ctors.cpp')
-rw-r--r--test/SemaCXX/cxx11-inheriting-ctors.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/SemaCXX/cxx11-inheriting-ctors.cpp b/test/SemaCXX/cxx11-inheriting-ctors.cpp
new file mode 100644
index 0000000..67d5521
--- /dev/null
+++ b/test/SemaCXX/cxx11-inheriting-ctors.cpp
@@ -0,0 +1,28 @@
+// RUN: %clang_cc1 -std=c++11 %s -verify
+
+// expected-no-diagnostics
+
+namespace PR15757 {
+ struct S {
+ };
+
+ template<typename X, typename Y> struct T {
+ template<typename A> T(X x, A &&a) {}
+
+ template<typename A> explicit T(A &&a)
+ noexcept(noexcept(T(X(), static_cast<A &&>(a))))
+ : T(X(), static_cast<A &&>(a)) {}
+ };
+
+ template<typename X, typename Y> struct U : T<X, Y> {
+ using T<X, Y>::T;
+ };
+
+ U<S, char> foo(char ch) { return U<S, char>(ch); }
+
+ int main() {
+ U<S, int> a(42);
+ U<S, char> b('4');
+ return 0;
+ }
+}
OpenPOWER on IntegriCloud