aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/rv-func.C
blob: e97fe3dd55fbe85793192b9cd5e16bf801dac7b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// PR c++/48457, Core 1238
// { dg-do compile { target c++11 } }

template<class T>
T&& create();

template<class T, class Arg>
void test() {
  T t(create<Arg>());
  (void) t;
}

void f (void (&)());
void f (void (&&)());

int main() {
  test<void(&)(), void()>();
  test<void(&&)(), void()>();
  // This call should choose the lvalue reference overload.
  // { dg-final { scan-assembler-not "_Z1fOFvvE" } }
  f(create<void()>());
}