diff options
author | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
---|---|---|
committer | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
commit | 554fd8c5195424bdbcabf5de30fdc183aba391bd (patch) | |
tree | 976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/g++.old-deja/g++.law/missed-error3.C | |
download | cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2 cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz |
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig;
imported gcc-4.6.4 source tree from verified upstream tarball.
downloading a git-generated archive based on the 'upstream' tag
should provide you with a source tree that is binary identical
to the one extracted from the above tarball.
if you have obtained the source via the command 'git clone',
however, do note that line-endings of files in your working
directory might differ from line-endings of the respective
files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.law/missed-error3.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.law/missed-error3.C | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.law/missed-error3.C b/gcc/testsuite/g++.old-deja/g++.law/missed-error3.C new file mode 100644 index 000000000..9f81bb451 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.law/missed-error3.C @@ -0,0 +1,124 @@ +// { dg-do assemble } +// GROUPS passed missed-error +// missed-error file +// From: Neil Wilson <csf004@cch.coventry.ac.uk> +// Date: Tue, 28 Apr 92 13:53:54 WET DST +// Subject: g++ version 2.1 bugs +// Message-ID: <15717.9204281253@cch.coventry.ac.uk> + + +// enum bool { FALSE = 0, TRUE = 1 }; + +typedef int T; + +class Traversable { +public: + virtual const T item() const = 0; + virtual const bool off() const = 0; + virtual ~Traversable() { } +}; + +class Chain : public Traversable { +public: + virtual const int count() const = 0; + virtual const bool empty() const = 0; + virtual void forth() const = 0; + virtual const bool isfirst() const = 0; + virtual const bool islast() const = 0; + virtual const int position() const = 0; + virtual const T first() const = 0; + virtual const T last() const = 0; + virtual const T i_th(const int index) const = 0; + virtual void start() const = 0; + virtual void back() const = 0; + virtual void finish() const = 0; + virtual void move(const int index) const = 0; + virtual void go(const int index) const = 0; + virtual void put(const T value) = 0; + virtual void put_i_th(const T value, const int index) = 0; + virtual void swap(const int index) = 0; + virtual void wipe_out() = 0; +}; +class List : public Chain { +protected: + int item_count; + int cursor_position; + virtual void go_offleft() const = 0; + virtual void go_offright() const = 0; + virtual void copy(const List& other) = 0; +public: + List() : item_count(0), cursor_position(0) { } + virtual const int count() const; + virtual const bool empty() const; + virtual const bool isfirst() const; + virtual const bool islast() const; + virtual const bool offleft() const; + virtual const bool offright() const; + virtual const bool off() const; + virtual const int position() const; + virtual const T first() const; + virtual const T last() const; + virtual const T i_th(const int index) const; + virtual void start() const; + virtual void forth() const; + virtual void back() const; + virtual void finish() const; + virtual void move(const int index) const; + virtual void go(const int index) const; + friend const bool operator==(const List& left, + const List& right); + friend const bool operator!=(const List& left, + const List& right); + virtual void put_i_th(const T value, const int index); + virtual void swap(const int index); +}; +typedef int T; +class Array { +private: + int lower_index; + int upper_index; + T *array; +protected: + virtual void allocate(const int minindex, const int maxindex); + virtual void copy(const Array&other); +public: + Array(const int minindex, const int maxindex); + Array(const Array& other); + virtual const int count() const; + virtual const int lower() const; + virtual const int upper() const; + virtual const T item(const int index) const; + const T Array::operator[](const int index); // { dg-error "" } qualification ignored + virtual const bool valid_index(const int index) const; + virtual const bool empty() const; + friend const bool operator==(const Array& left, const Array& right); + friend const bool operator!=(const Array& left, const Array& right); + virtual void put(const T value, const int index); + virtual void wipe_out(); + Array& operator=(const Array& other); + virtual ~Array(); +}; +class Fixed_List: public List, private Array { +protected: + virtual void go_offleft() const; + virtual void go_offright() const; + virtual void copy(const List& other); +public: + Fixed_List(const List& other); + Fixed_List(const int size): Array(1, size) { } + virtual const bool empty() const; + virtual const int count() const; + virtual const T item() const; + virtual const T i_th(const int index) const; + virtual void move(const int index) const; + virtual void put(const T value); + virtual void put_i_th(const T value, const int index); + virtual void wipe_out() { } + Fixed_List& operator=(const List& other); +}; + +void Fixed_List::go_offleft() const +{ + cursor_position = 0;// { dg-error "" } +} + |