OSDN Git Service

PR c++/6057
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / cpp0x / decltype17.C
1 // PR c++/36628
2 // { dg-options "-std=c++0x" }
3 // { dg-do run }
4
5 #include <typeinfo>
6 #include <string.h>
7
8 int  rvalue();
9 int& lvalueref();
10 int&& rvalueref();
11
12 decltype(true ? rvalue() : rvalue()) f()
13 {}
14
15 decltype(true ? lvalueref() : lvalueref()) g()
16 {}
17
18 decltype(true ? rvalueref() : rvalueref()) h()
19 {}
20
21 int main()
22 {
23   if (strcmp (typeid(f).name(), "FivE") != 0)
24     return 1;
25   if (strcmp (typeid(g).name(), "FRivE") != 0)
26     return 2;
27   if (strcmp (typeid(h).name(), "FivE") != 0)
28     return 3;
29 }