diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/delete2.C')
-rwxr-xr-x | gcc/testsuite/g++.old-deja/g++.jason/delete2.C | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/delete2.C b/gcc/testsuite/g++.old-deja/g++.jason/delete2.C new file mode 100755 index 0000000..7748e2b --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.jason/delete2.C @@ -0,0 +1,16 @@ +// PRMS Id: 5003 +// Bug: g++ complains about calling the destructor for a const object. +// Build don't link: + +struct A { +public: + ~A(); +}; + +const A foo (); + +void bar() +{ + A n; + n = foo(); // gets bogus error - deleting const +} |