Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/decltype17.C

raw
1 // PR c++/36628
2 // { dg-do run { target c++11 } }
3 // { dg-additional-options "-Wno-return-type" }
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(), "FOivE") != 0)
28 return 3;
29
30 return 0;
31 }