aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/init/pr35878_1.C
blob: b45c0097a933d6827b9cf9c331aa787e1cdce7b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// { dg-options "-O2 --std=gnu++11" }
// { dg-do compile }
// { dg-final { scan-assembler "test.*%rdi, %rdi" { target i?86-*-* x86_64-*-* } } }
#include <new>
#include <utility>

struct s1{
  int a;
  int b;
  int c;
};

void f1 (s1 * v, s1&& s)
{
	new (v) s1(std::move(s));
}

void f2 (s1 * v, s1&& s)
{
	*v = std::move(s);
}