aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp23/auto-fncast1.C
blob: 25e53c4d61ea7c4a69b429cb85d18ea1f9f6fcd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// PR c++/103049
// P0849R8 - auto(x)
// { dg-do compile { target c++23 } }
// Testcase from P0849R8.

struct A {};
void f(A&) = delete;  // #1
void f(A&&); // #2
A& g();
void h() {
//  f(g());      // calls #1
  f(A(g()));     // calls #2 with a temporary object
  f(auto(g()));  // calls #2 with a temporary object
}