Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / alias-decl-79.C
blob58436f907efe2efc7c036f826280e382e2196d6f
1 // PR c++/115897
2 // { dg-do compile { target c++11 } }
4 template<class T, class U>
5 struct is_same { static constexpr bool value = __is_same(T, U); };
7 #if __cpp_variable_templates
8 template<class T, class U>
9 constexpr bool is_same_v = __is_same(T, U);
10 #endif
12 template<class T> struct A;
14 template<class T>
15 void f() {
16   using B [[gnu::vector_size(16)]] = T;
17   static_assert(!is_same<T, B>::value, "");
18   static_assert(!is_same<A<T>, A<B>>::value, "");
19 #if __cpp_variable_templates
20   static_assert(!is_same_v<T, B>, "");
21   static_assert(!is_same_v<A<T>, A<B>>, "");
22 #endif
25 template<class T>
26 void g() {
27   using C [[gnu::vector_size(16)]] = T*;
28   static_assert(!is_same<T*, C>::value, "");
29   static_assert(!is_same<A<T*>, A<C>>::value, "");
30 #if __cpp_variable_templates
31   static_assert(!is_same_v<T*, C>, "");
32   static_assert(!is_same_v<A<T*>, A<C>>, "");
33 #endif
36 template void f<float>();
37 template void g<float>();