1 // PR c++/48457, Core 1238 2 // { dg-do compile { target c++11 } } 3 4 template<class T> 5 T&& create(); 6 7 template<class T, class Arg> test()8void test() { 9 T t(create<Arg>()); 10 (void) t; 11 } 12 13 void f (void (&)()); 14 void f (void (&&)()); 15 main()16int 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 } 23