diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/other/default7.C')
-rw-r--r-- | gcc/testsuite/g++.dg/other/default7.C | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/other/default7.C b/gcc/testsuite/g++.dg/other/default7.C new file mode 100644 index 000000000..ec523bf89 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/default7.C @@ -0,0 +1,20 @@ +/* { dg-do assemble } */ +/* { dg-options "-O1" }*/ +// This was PR C++/31165 +// We used to copy the whole decl when we just wantted to +// unshare some expressions for the default argument. +class string { + char *ptr; + int len; + int sz; +}; +class cset { } _cset_init; +string an_empty_string; +void f(string& = an_empty_string); +void +h (void ) +{ +f(); +} + + |