Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / gcc / testsuite / g++.dg / cpp0x / decltype-54581.C
1 /* { dg-do compile } */
2 /* { dg-options "-std=gnu++11 -Wall" } */
3
4 typedef float v4f __attribute__((vector_size(4*sizeof(float))));
5
6 template <class T> void eat (T&&) {}
7
8 void test1 ()
9 {
10   v4f x = {0,1,2,3};
11   typedef decltype (x < x) v4i;
12   v4i y = {4,5,6,7}; // v4i is not opaque
13   eat (y);
14 }
15
16 template<class V>
17 void test2 ()
18 {
19   V x = {0,1,2,3};
20   typedef decltype (x < x) v4i;
21   v4i y = {4,5,6,7}; // v4i is not opaque
22   eat (y);
23 }
24
25 int main(){
26   test1();
27   test2<v4f>();
28 }