repo.or.cz
/
gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Fortran: Fix PR 47485.
[gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
warn
/
pr5645.C
blob
5ca61bdba4560a82fda24dd82a767cf9c20e4a5c
1
// PR5645: gcc warns that pure virtual class not explicitly initialized.
2
// { dg-do compile }
3
// { dg-options "-Wall -Wextra" }
4
5
class a {
6
public:
7
virtual int f() = 0;
8
virtual int g() = 0;
9
};
10
11
class b : public a {
12
public:
13
b();
14
b(const b& c);
15
16
protected:
17
int i;
18
};
19
20
b::b() {}
21
22
b::b(const b& c) { // { dg-bogus "base class .class a. should be explicitly initialized in the copy constructor" }
23
i = c.i;
24
}
25
26
struct X {};
27
28
struct Y : X
29
{
30
Y (Y const&) {}
31
};
32