summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.brendan/synth1.C
blob: 3a27e63cf04ad1d90541de778818de2f1e7cd8a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// { dg-do assemble }
// { dg-xfail-if "" { sparc64-*-elf } { "*" } { "" } }
// { dg-options "-pedantic-errors -g -Wall" }
// GROUPS passed synthetics
// Check to make sure that g++ doesn't get freaked out about the use
// of generated methods that it supposedly "can't see".

class Char {
public:
    Char();
    Char(char v);
    
    // synthetic copy-constructor and operator=
private:
    char value;
};

class XChar: public Char {
public:
    XChar();
    XChar(char v, int serial);
    
    void operator=(const XChar& other);
private:
    int serial;
};

void
XChar::operator=(const XChar& other)
{
    Char::operator=(other);
    // serial stays the same
}