summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/init/copy4.C
blob: bfff685666a6cfe5f083cf8213910d0d846033ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// PR c++/9342
// We were failing to wrap def().user in a TARGET_EXPR, so copying it
// into the reference temp used a bitwise copy.

struct QString
{
    QString( const QString & );
    QString &operator=( const QString & );
};
struct ServerSettings
{
    QString user;
};
extern ServerSettings def();
extern void arg( const QString& a );
void startSession( bool b, QString s )
{
    arg (b ? def().user : s);
}