aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype17.C
blob: 6e5854db6c91f4d93c9a522b653d58e9ac2bff44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// PR c++/36628
// { dg-do run { target c++11 } }

#include <typeinfo>
#include <string.h>

int  rvalue();
int& lvalueref();
int&& rvalueref();

decltype(true ? rvalue() : rvalue()) f()
{}

decltype(true ? lvalueref() : lvalueref()) g()
{}

decltype(true ? rvalueref() : rvalueref()) h()
{}

int main()
{
  if (strcmp (typeid(f).name(), "FivE") != 0)
    return 1;
  if (strcmp (typeid(g).name(), "FRivE") != 0)
    return 2;
  if (strcmp (typeid(h).name(), "FOivE") != 0)
    return 3;
}