minix/external/bsd/llvm/dist/clang/test/SemaCXX/cxx11-inheriting-ctors.cpp
Lionel Sambuc f4a2713ac8 Importing netbsd clang -- pristine
Change-Id: Ia40e9ffdf29b5dab2f122f673ff6802a58bc690f
2014-07-28 17:05:57 +02:00

28 lines
561 B
C++

// 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;
}
}