repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
re PR c++/35878 ([LWG 2302] Useless NULL pointer check when constructing object)
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
init
/
pr35878_3.C
blob
8a5614f12ffc0afb31ca744351503382b2c3001e
1
// { dg-options "-O2 --std=gnu++17" }
2
// { dg-do compile }
3
// { dg-final { scan-assembler-not "test.*%rdi, %rdi" { target i?86-*-* x86_64-*-* } } }
4
#include <new>
5
#include <utility>
6
7
struct s1{
8
int a;
9
int b;
10
int c;
11
};
12
13
void f1 (s1 * v, s1&& s)
14
{
15
new (v) s1(std::move(s));
16
}
17
18
void f2 (s1 * v, s1&& s)
19
{
20
*v = std::move(s);
21
}