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
Fix PR c++/69139 (deduction failure with trailing return type)
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp0x
/
dc6.C
blob
b16c0b47ba0d34d30b5d06c9ff80bd5ae4af5768
1
// { dg-do run { target c++11 } }
2
3
int a_ct;
4
5
struct A
6
{
7
A(int i): i(i) { ++a_ct; }
8
A(const A& a): i(a.i) { ++a_ct; }
9
~A() { --a_ct; }
10
int i;
11
};
12
13
struct V
14
{
15
V() { }
16
};
17
18
struct B: virtual V
19
{
20
A a;
21
B(A a): a(a) { }
22
B(int i): B(A(i)) { }
23
};
24
25
struct C: B
26
{
27
C(int i): B(i) { }
28
};
29
30
int main()
31
{
32
{
33
B b(42);
34
C c(24);
35
if (b.a.i != 42
36
||c.a.i != 24)
37
__builtin_abort ();
38
}
39
return a_ct;
40
}