OSDN Git Service

c4dd048778964cee4732e5b5b490f3cb0109c073
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / ext / alias-decl-attr4.C
1 // { dg-options "-std=c++0x" }
2 // { dg-do run }
3
4 using global_vector_type  __attribute__((vector_size(16))) = float;
5
6 template <class T> struct A
7 {
8     using type = T;
9 };
10
11 template < typename Val > struct S
12 {
13     using vector_type __attribute__((vector_size(16))) =
14         typename A<Val>::type
15         typedef Val vector_type2 __attribute__((vector_size(16)));
16     int pr_size() { return sizeof(vector_type); }
17     int pr_size2() { return sizeof(vector_type2); }
18 };
19
20 int main()
21 {
22   if (sizeof (S<float>::vector_type) != sizeof (global_vector_type))
23     return 1;
24   if (sizeof (S<float>::vector_type2) != sizeof (global_vector_type))
25     return 2;
26
27   S<float> x;
28   if (x.pr_size() != sizeof (global_vector_type))
29     return 3;
30   if (x.pr_size2() != sizeof (global_vector_type))
31     return 4;
32   
33   return 0;
34 }