db142961128a36ef6b7e45d123caa97d42f03a20
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / rv-func.C
1 // PR c++/48457, Core 1238
2 // { dg-options -std=c++0x }
3
4 template<class T>
5 T&& create();
6
7 template<class T, class Arg>
8 void test() {
9 T t(create<Arg>());
10 (void) t;
11 }
12
13 void f (void (&)());
14 void f (void (&&)());
15
16 int main() {
17 test<void(&)(), void()>();
18 test<void(&&)(), void()>();
19 // This call should choose the lvalue reference overload.
20 // { dg-final { scan-assembler-not "_Z1fOFvvE" } }
21 f(create<void()>());
22 }