* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / narrowing1.C
blobba4bb4e9f0dd52f7cf301f17b13c22830fbd0201
1 // PR c++/80691
2 // { dg-do compile { target c++11 } }
4 struct true_type { static constexpr bool value = true; };
5 struct false_type { static constexpr bool value = false; };
6 template<typename...> using void_t = void;
7 template<typename T> T&& declval();
9 template<typename T, typename U, typename = void>
10 struct is_nonnarrowing_conversion : false_type {};
12 template<typename T, typename U>
13 struct is_nonnarrowing_conversion<T, U,
14     void_t<decltype(T{ declval<U>() })>> : true_type {};
16 template<typename T>
17 class wrapper
19 public:
20     wrapper(T) {}
23 static_assert(!is_nonnarrowing_conversion<int, float>::value, "");
24 static_assert(!is_nonnarrowing_conversion<wrapper<int>, float>::value, "");