Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/alias-decl-77.C

raw
1 // PR c++/115897
2 // { dg-do compile { target c++11 } }
3
4 template<class T, class U>
5 struct is_same { static constexpr bool value = __is_same(T, U); };
6
7 #if __cpp_variable_templates
8 template<class T, class U>
9 constexpr bool is_same_v = __is_same(T, U);
10 #endif
11
12 template<class T>
13 using A [[gnu::vector_size(16)]] = T;
14
15 template<class T>
16 using B = T;
17
18 template<class T>
19 using C [[gnu::vector_size(16)]] = B<T>;
20
21 template<class T>
22 void f() {
23 static_assert(!is_same<T, A<T>>::value, "");
24 static_assert(is_same<C<T>, A<T>>::value, "");
25
26 #if __cpp_variable_templates
27 static_assert(!is_same_v<T, A<T>>, "");
28 static_assert(is_same_v<C<T>, A<T>>, "");
29 #endif
30 };
31
32 template void f<float>();