diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/init/copy4.C')
-rw-r--r-- | gcc/testsuite/g++.dg/init/copy4.C | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/init/copy4.C b/gcc/testsuite/g++.dg/init/copy4.C new file mode 100644 index 000000000..bfff68566 --- /dev/null +++ b/gcc/testsuite/g++.dg/init/copy4.C @@ -0,0 +1,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); +} |