diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/lvalue.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.jason/lvalue.C | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/lvalue.C b/gcc/testsuite/g++.old-deja/g++.jason/lvalue.C new file mode 100644 index 000000000..643641eec --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.jason/lvalue.C @@ -0,0 +1,22 @@ +// { dg-do assemble } +// Bug: Scoped method calls don't propagate the constness of `this'. +// PRMS Id: 4181 (second testcase) + +class D; + +class Bptr +{ +public: + Bptr& operator=(D*); + const Bptr& operator=(const D*) const; +}; + +class Dptr : public Bptr +{ +public: + const Dptr& operator=(const D* rep) const + { + Bptr::operator=(rep); + return *this; + } +}; |