summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/g++.dg/cpp0x/rv-func.C
blob: db142961128a36ef6b7e45d123caa97d42f03a20 (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-options -std=c++0x }

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()>());
}
OpenPOWER on IntegriCloud