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
2018-10-23 Richard Biener <rguenther@suse.de>
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp0x
/
Wnarrowing11.C
blob
5b7323633c7cad1fe9a645fc5c3826742a294b07
1
// PR c++/65043
2
// { dg-do compile { target c++11 } }
3
4
struct X
5
{
6
X(bool) { }
7
};
8
9
struct Y
10
{
11
Y(char) { }
12
};
13
14
struct Z
15
{
16
Z(char16_t) { }
17
};
18
19
struct W
20
{
21
W(char32_t) { }
22
};
23
24
int main()
25
{
26
X x{1.2}; // { dg-error "narrowing conversion" }
27
Y y{1.2}; // { dg-error "narrowing conversion" }
28
Z z{1.2}; // { dg-error "narrowing conversion" }
29
W w{1.2}; // { dg-error "narrowing conversion" }
30
}