diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.robertl')
124 files changed, 0 insertions, 6661 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/980310-1.C b/gcc/testsuite/g++.old-deja/g++.robertl/980310-1.C deleted file mode 100644 index ee558f41221..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/980310-1.C +++ /dev/null @@ -1,43 +0,0 @@ -// Special g++ Options: -g -// Internal compiler error on egcs 1.0.1 i586-pc-linux-gnulibc1. -// From: Max Lawson <mlawson@drfmc.ceng.cea.fr> -// Message-Id: <9803091022.AA07520@drfmc.ceng.cea.fr> - - -typedef __SIZE_TYPE__ size_t; - -struct dummy { }; - -struct arrrrrgh { }; - -template<class Par,class Rand = arrrrrgh> -struct whyyyyyyy { }; - -template<class T, class S =dummy> -struct grrrrrrrr { }; - -template<class Par, class Par2 =Par, class Rand =arrrrrgh> -class no_future -{ -public: - - template<class S> - no_future(const grrrrrrrr<whyyyyyyy<Par,Rand>*,S>& man ) { } - - ~no_future( ) { } - -private: - - no_future(const no_future&); - no_future& operator=(const no_future&); -}; - -int main( ) -{ - grrrrrrrr<whyyyyyyy<double>*> man; - - no_future<double> here(man); - - return 0; -} - diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/README b/gcc/testsuite/g++.old-deja/g++.robertl/README deleted file mode 100644 index 36029c7d9c7..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/README +++ /dev/null @@ -1,18 +0,0 @@ -This directory contains a hodgepodge of problem reports that appeared on -the egcs-bugs or egcs mailing lists. Just like the reports themselves, -they tend to be poorly understood and poorly organized. However, we -drop them into the testsuite on the premise that internal compiler errors -are always bad - no matter how bogus the source. - -If you really understand C++ (and you know who you are) if you find -entries in this area that are bogus, feel free to just fix them or nuke -them. You don't need my permission. - -Many of the first entries in this area were done in "block mode" by -whipping through many months of archives. In hindsight, some important -information was lost, but being picky on over 8,000 messages is a sure -way to never get out of the gate. - -We'll do better now. - -Robert Lipe diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb10.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb10.C deleted file mode 100644 index 7da5d7562ee..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb10.C +++ /dev/null @@ -1,30 +0,0 @@ -// Build don't link: -template <int object_size> -class _fixed_size_allocator -{ - private: - - struct something { }; - static something * asdf; - - public: - - static void delete_object (); -}; - - -template <class T> -class object_allocator -{ - private: - - typedef _fixed_size_allocator<sizeof (T)> allocator; - - public: - - static void deallocate (T * p) - { - allocator::delete_object (reinterpret_cast<void *> (p)); - } -}; - diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb101.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb101.C deleted file mode 100644 index 74c6cbb8141..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb101.C +++ /dev/null @@ -1,3886 +0,0 @@ -// Special g++ Options: -fcheck-memory-usage -// Build don't link: - - - - - - - - - - - - - - - - - - - - - - - - - - - -#pragma interface - -#define _IOSTREAM_H - - - - - - - - - - - - - - - - - - - - - - - - - - -#define _STREAMBUF_H - -#pragma interface - - - - -#define _IO_NEW_STREAMS - -extern "C" { - - - - - - - - - - - - - - - - - - - - - - - - - - - -#define _IO_STDIO_H - - - -#define _G_config_h -#define _G_LIB_VERSION "0.67" -#define _G_NAMES_HAVE_UNDERSCORE 1 -#define _G_VTABLE_LABEL_HAS_LENGTH 1 -#define _G_VTABLE_LABEL_PREFIX "__vt$" -#define _G_HAVE_ST_BLKSIZE 1 -typedef long _G_clock_t; -typedef short _G_dev_t; -typedef long _G_fpos_t; -typedef unsigned short _G_gid_t; -typedef unsigned long _G_ino_t; -typedef unsigned short _G_mode_t; -typedef short _G_nlink_t; -typedef long _G_off_t; -typedef int _G_pid_t; - - - -typedef int _G_ptrdiff_t; -typedef int _G_sigset_t; - - - -typedef unsigned int _G_size_t; -typedef long _G_time_t; -typedef unsigned short _G_uid_t; - - - -typedef __wchar_t _G_wchar_t; -typedef int _G_ssize_t; -typedef int _G_wint_t; -typedef char * _G_va_list; -#define _G_signal_return_type void -#define _G_sprintf_return_type char* - -typedef signed char _G_int8_t; - -typedef unsigned char _G_uint8_t; -typedef short _G_int16_t; -typedef unsigned short _G_uint16_t; -typedef long _G_int32_t; -typedef unsigned long _G_uint32_t; - -#define HAVE_INT64 -typedef long long _G_int64_t; -typedef unsigned long long _G_uint64_t; - -#define _G_BUFSIZ 1024 -#define _G_FOPEN_MAX 32 -#define _G_FILENAME_MAX 1024 -#define _G_NULL 0 - -#define _G_ARGS(ARGLIST) ARGLIST - - - - - - - - - -#define _G_HAVE_ATEXIT 0 -#define _G_HAVE_SYS_RESOURCE 1 -#define _G_HAVE_SYS_SOCKET 1 -#define _G_HAVE_SYS_WAIT 1 -#define _G_HAVE_UNISTD 1 -#define _G_HAVE_DIRENT 1 -#define _G_HAVE_CURSES 1 -#define _G_MATH_H_INLINES 0 -#define _G_HAVE_BOOL 1 - - -#define _IO_pos_t _G_fpos_t -#define _IO_fpos_t _G_fpos_t -#define _IO_size_t _G_size_t -#define _IO_ssize_t _G_ssize_t -#define _IO_off_t _G_off_t -#define _IO_pid_t _G_pid_t -#define _IO_uid_t _G_uid_t -#define _IO_HAVE_SYS_WAIT _G_HAVE_SYS_WAIT -#define _IO_HAVE_ST_BLKSIZE _G_HAVE_ST_BLKSIZE -#define _IO_BUFSIZ _G_BUFSIZ -#define _IO_va_list _G_va_list - - - - - - - - -#define __P(protos) protos - - - - - - - - -#define _PARAMS(protos) __P(protos) - - - - - -#define _IO_UNIFIED_JUMPTABLES 1 - -#define _IO_USE_DTOA 1 - - - -#define EOF (-1) - - - - -#define NULL (__null) - - - - - - - - - -#define _IOS_INPUT 1 -#define _IOS_OUTPUT 2 -#define _IOS_ATEND 4 -#define _IOS_APPEND 8 -#define _IOS_TRUNC 16 -#define _IOS_NOCREATE 32 -#define _IOS_NOREPLACE 64 -#define _IOS_BIN 128 - - - - - - - -#define _IO_MAGIC 0xFBAD0000 -#define _OLD_STDIO_MAGIC 0xFABC0000 -#define _IO_MAGIC_MASK 0xFFFF0000 -#define _IO_USER_BUF 1 -#define _IO_UNBUFFERED 2 -#define _IO_NO_READS 4 -#define _IO_NO_WRITES 8 -#define _IO_EOF_SEEN 0x10 -#define _IO_ERR_SEEN 0x20 -#define _IO_DELETE_DONT_CLOSE 0x40 -#define _IO_LINKED 0x80 -#define _IO_IN_BACKUP 0x100 -#define _IO_LINE_BUF 0x200 -#define _IO_TIED_PUT_GET 0x400 -#define _IO_CURRENTLY_PUTTING 0x800 -#define _IO_IS_APPENDING 0x1000 -#define _IO_IS_FILEBUF 0x2000 -#define _IO_BAD_SEEN 0x4000 - - -#define _IO_SKIPWS 01 -#define _IO_LEFT 02 -#define _IO_RIGHT 04 -#define _IO_INTERNAL 010 -#define _IO_DEC 020 -#define _IO_OCT 040 -#define _IO_HEX 0100 -#define _IO_SHOWBASE 0200 -#define _IO_SHOWPOINT 0400 -#define _IO_UPPERCASE 01000 -#define _IO_SHOWPOS 02000 -#define _IO_SCIENTIFIC 04000 -#define _IO_FIXED 010000 -#define _IO_UNITBUF 020000 -#define _IO_STDIO 040000 -#define _IO_DONT_CLOSE 0100000 -#define _IO_BOOLALPHA 0200000 - - -struct _IO_jump_t; struct _IO_FILE; - - - - - - - - - - - - typedef void _IO_lock_t; - - - - - - - -struct _IO_marker { - struct _IO_marker *_next; - struct _IO_FILE *_sbuf; - - - - int _pos; - -}; - -struct _IO_FILE { - int _flags; -#define _IO_file_flags _flags - - - - char* _IO_read_ptr; - char* _IO_read_end; - char* _IO_read_base; - char* _IO_write_base; - char* _IO_write_ptr; - char* _IO_write_end; - char* _IO_buf_base; - char* _IO_buf_end; - - char *_IO_save_base; - char *_IO_backup_base; - char *_IO_save_end; - - struct _IO_marker *_markers; - - struct _IO_FILE *_chain; - - int _fileno; - int _blksize; - _G_off_t _offset; - -#define __HAVE_COLUMN - - unsigned short _cur_column; - char _unused; - char _shortbuf[1]; - - - - - - -}; - - - - - -struct _IO_FILE_plus; -extern struct _IO_FILE_plus _IO_stdin_, _IO_stdout_, _IO_stderr_; -#define _IO_stdin ((_IO_FILE*)(&_IO_stdin_)) -#define _IO_stdout ((_IO_FILE*)(&_IO_stdout_)) -#define _IO_stderr ((_IO_FILE*)(&_IO_stderr_)) - - - -typedef struct -{ - _G_ssize_t (*read) (struct _IO_FILE *, void *, _G_ssize_t ) ; - _G_ssize_t (*write) (struct _IO_FILE *, const void *, _G_ssize_t ) ; - _G_fpos_t (*seek) (struct _IO_FILE *, _G_off_t , int) ; - int (*close) (struct _IO_FILE *) ; -} _IO_cookie_io_functions_t; - - -struct _IO_cookie_file -{ - struct _IO_FILE file; - const void *vtable; - void *cookie; - _IO_cookie_io_functions_t io_functions; -}; - - - -extern "C" { - - -extern int __underflow (_IO_FILE *) ; -extern int __uflow (_IO_FILE *) ; -extern int __overflow (_IO_FILE *, int) ; - -#define _IO_getc_unlocked(_fp) ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end ? __uflow (_fp) : *(unsigned char *) (_fp)->_IO_read_ptr++) - - -#define _IO_peekc_unlocked(_fp) ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end && __underflow (_fp) == EOF ? EOF : *(unsigned char *) (_fp)->_IO_read_ptr) - - - - -#define _IO_putc_unlocked(_ch, _fp) (((_fp)->_IO_write_ptr >= (_fp)->_IO_write_end) ? __overflow (_fp, (unsigned char) (_ch)) : (unsigned char) (*(_fp)->_IO_write_ptr++ = (_ch))) - - - - -#define _IO_feof_unlocked(__fp) (((__fp)->_flags & _IO_EOF_SEEN) != 0) -#define _IO_ferror_unlocked(__fp) (((__fp)->_flags & _IO_ERR_SEEN) != 0) - -extern int _IO_getc (_IO_FILE *__fp) ; -extern int _IO_putc (int __c, _IO_FILE *__fp) ; -extern int _IO_feof (_IO_FILE *__fp) ; -extern int _IO_ferror (_IO_FILE *__fp) ; - -extern int _IO_peekc_locked (_IO_FILE *__fp) ; - - -#define _IO_PENDING_OUTPUT_COUNT(_fp) ((_fp)->_IO_write_ptr - (_fp)->_IO_write_base) - - -extern void _IO_flockfile (_IO_FILE *) ; -extern void _IO_funlockfile (_IO_FILE *) ; -extern int _IO_ftrylockfile (_IO_FILE *) ; - - - - -#define _IO_peekc(_fp) _IO_peekc_unlocked (_fp) -#define _IO_flockfile(_fp) -#define _IO_funlockfile(_fp) -#define _IO_ftrylockfile(_fp) -#define _IO_cleanup_region_start(_fct, _fp) -#define _IO_cleanup_region_end(_Doit) - - - -extern int _IO_vfscanf (_IO_FILE *, const char *, _G_va_list , int *) ; -extern int _IO_vfprintf (_IO_FILE *, const char *, _G_va_list ) ; -extern _G_ssize_t _IO_padn (_IO_FILE *, int, _G_ssize_t ) ; -extern _G_size_t _IO_sgetn (_IO_FILE *, void *, _G_size_t ) ; - -extern _G_fpos_t _IO_seekoff (_IO_FILE *, _G_off_t , int, int) ; -extern _G_fpos_t _IO_seekpos (_IO_FILE *, _G_fpos_t , int) ; - -extern void _IO_free_backup_area (_IO_FILE *) ; - - -} - - - - -} - - - - - - - - - - - - - - - - - - - - -#define _IO_wchar_t short - - -extern "C++" { -class istream; -class ostream; class streambuf; - - - - - -typedef _G_off_t streamoff; -typedef _G_fpos_t streampos; -typedef _G_ssize_t streamsize; - -typedef unsigned long __fmtflags; -typedef unsigned char __iostate; - -struct _ios_fields -{ - streambuf *_strbuf; - ostream* _tie; - int _width; - __fmtflags _flags; - short _fill; - __iostate _state; - __iostate _exceptions; - int _precision; - - void *_arrays; -}; - -#define _IOS_GOOD 0 -#define _IOS_EOF 1 -#define _IOS_FAIL 2 -#define _IOS_BAD 4 - -#define _IO_INPUT 1 -#define _IO_OUTPUT 2 -#define _IO_ATEND 4 -#define _IO_APPEND 8 -#define _IO_TRUNC 16 -#define _IO_NOCREATE 32 -#define _IO_NOREPLACE 64 -#define _IO_BIN 128 - - - -class ios : public _ios_fields { - ios& operator=(ios&); - ios (const ios&); - public: - typedef __fmtflags fmtflags; - typedef int iostate; - typedef int openmode; - typedef int streamsize; - enum io_state { - goodbit = 0 , - eofbit = 1 , - failbit = 2 , - badbit = 4 }; - enum open_mode { - in = 1 , - out = 2 , - ate = 4 , - app = 8 , - trunc = 16 , - nocreate = 32 , - noreplace = 64 , - bin = 128 , - binary = 128 }; - enum seek_dir { beg, cur, end}; - typedef enum seek_dir seekdir; - - enum { skipws= 01 , - left= 02 , right= 04 , internal= 010 , - dec= 020 , oct= 040 , hex= 0100 , - showbase= 0200 , showpoint= 0400 , - uppercase= 01000 , showpos= 02000 , - scientific= 04000 , fixed= 010000 , - unitbuf= 020000 , stdio= 040000 - - - - }; - enum { - basefield=dec+oct+hex, - floatfield = scientific+fixed, - adjustfield = left+right+internal - }; - - - - ostream* tie() const { return _tie; } - ostream* tie(ostream* val) { ostream* save=_tie; _tie=val; return save; } - - - short fill() const { return (short )_fill; } - short fill(short newf) - {short oldf = (short )_fill; _fill = (char)newf; return oldf;} - fmtflags flags() const { return _flags; } - fmtflags flags(fmtflags new_val) { - fmtflags old_val = _flags; _flags = new_val; return old_val; } - int precision() const { return _precision; } - int precision(int newp) { - unsigned short oldp = _precision; _precision = (unsigned short)newp; - return oldp; } - fmtflags setf(fmtflags val) { - fmtflags oldbits = _flags; - _flags |= val; return oldbits; } - fmtflags setf(fmtflags val, fmtflags mask) { - fmtflags oldbits = _flags; - _flags = (_flags & ~mask) | (val & mask); return oldbits; } - fmtflags unsetf(fmtflags mask) { - fmtflags oldbits = _flags; - _flags &= ~mask; return oldbits; } - int width() const { return _width; } - int width(int val) { int save = _width; _width = val; return save; } - - - - - void _throw_failure() const { } - - void clear(iostate state = 0) { - _state = _strbuf ? state : state|badbit; - if (_state & _exceptions) _throw_failure(); } - void set(iostate flag) { _state |= flag; - if (_state & _exceptions) _throw_failure(); } - void setstate(iostate flag) { _state |= flag; - if (_state & _exceptions) _throw_failure(); } - int good() const { return _state == 0; } - int eof() const { return _state & ios::eofbit; } - int fail() const { return _state & (ios::badbit|ios::failbit); } - int bad() const { return _state & ios::badbit; } - iostate rdstate() const { return _state; } - operator void*() const { return fail() ? (void*)0 : (void*)(-1); } - int operator!() const { return fail(); } - iostate exceptions() const { return _exceptions; } - void exceptions(iostate enable) { - _exceptions = enable; - if (_state & _exceptions) _throw_failure(); } - - streambuf* rdbuf() const { return _strbuf; } - streambuf* rdbuf(streambuf *_s) { - streambuf *_old = _strbuf; _strbuf = _s; clear (); return _old; } - - static int sync_with_stdio(int on); - static void sync_with_stdio() { sync_with_stdio(1); } - static fmtflags bitalloc(); - static int xalloc(); - void*& pword(int); - void* pword(int) const; - long& iword(int); - long iword(int) const; - - - - - - - - - - - class Init { - public: - Init () { } - }; - - protected: - inline ios(streambuf* sb = 0, ostream* tie_to = 0); - inline virtual ~ios(); - inline void init(streambuf* sb, ostream* tie = 0); -}; - - - - -typedef ios::seek_dir _seek_dir; - - - - - - - - - - -class streammarker : private _IO_marker { - friend class streambuf; - void set_offset(int offset) { _pos = offset; } - public: - streammarker(streambuf *sb); - ~streammarker(); - int saving() { return 1; } - int delta(streammarker&); - int delta(); -}; - -struct streambuf : public _IO_FILE { - friend class ios; - friend class istream; - friend class ostream; - friend class streammarker; - const void *&_vtable() { return *(const void**)((_IO_FILE*)this + 1); } - protected: - static streambuf* _list_all; - _IO_FILE*& xchain() { return _chain; } - void _un_link(); - void _link_in(); - char* gptr() const - { return _flags & 0x100 ? _IO_save_base : _IO_read_ptr; } - char* pptr() const { return _IO_write_ptr; } - char* egptr() const - { return _flags & 0x100 ? _IO_save_end : _IO_read_end; } - char* epptr() const { return _IO_write_end; } - char* pbase() const { return _IO_write_base; } - char* eback() const - { return _flags & 0x100 ? _IO_save_base : _IO_read_base;} - char* base() const { return _IO_buf_base; } - char* ebuf() const { return _IO_buf_end; } - int blen() const { return _IO_buf_end - _IO_buf_base; } - void xput_char(char c) { *_IO_write_ptr++ = c; } - int xflags() { return _flags ; } - int xflags(int f) {int fl = _flags ; _flags = f; return fl;} - void xsetflags(int f) { _flags |= f; } - void xsetflags(int f, int mask) - { _flags = (_flags & ~mask) | (f & mask); } - void gbump(int n) - { _flags & 0x100 ? (_IO_save_base+=n):(_IO_read_ptr+=n);} - void pbump(int n) { _IO_write_ptr += n; } - void setb(char* b, char* eb, int a=0); - void setp(char* p, char* ep) - { _IO_write_base=_IO_write_ptr=p; _IO_write_end=ep; } - void setg(char* eb, char* g, char *eg) { - if (_flags & 0x100 ) _IO_free_backup_area(this); - _IO_read_base = eb; _IO_read_ptr = g; _IO_read_end = eg; } - char *shortbuf() { return _shortbuf; } - - int in_backup() { return _flags & 0x100 ; } - - char *Gbase() { return in_backup() ? _IO_save_base : _IO_read_base; } - - char *eGptr() { return in_backup() ? _IO_save_end : _IO_read_end; } - - char *Bbase() { return in_backup() ? _IO_read_base : _IO_save_base; } - char *Bptr() { return _IO_backup_base; } - - char *eBptr() { return in_backup() ? _IO_read_end : _IO_save_end; } - char *Nbase() { return _IO_save_base; } - char *eNptr() { return _IO_save_end; } - int have_backup() { return _IO_save_base != (__null) ; } - int have_markers() { return _markers != (__null) ; } - void free_backup_area(); - void unsave_markers(); - int put_mode() { return _flags & 0x800 ; } - int switch_to_get_mode(); - - streambuf(int flags=0); - public: - static int flush_all(); - static void flush_all_linebuffered(); - virtual ~streambuf(); - virtual int overflow(int c = (-1) ); - virtual int underflow(); - virtual int uflow(); - virtual int pbackfail(int c); - - virtual streamsize xsputn(const char* s, streamsize n); - virtual streamsize xsgetn(char* s, streamsize n); - virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out); - virtual streampos seekpos(streampos pos, int mode = ios::in|ios::out); - - streampos pubseekoff(streamoff o, _seek_dir d, int mode=ios::in|ios::out) - { return _IO_seekoff (this, o, d, mode); } - streampos pubseekpos(streampos pos, int mode = ios::in|ios::out) - { return _IO_seekpos (this, pos, mode); } - streampos sseekoff(streamoff, _seek_dir, int mode=ios::in|ios::out); - streampos sseekpos(streampos pos, int mode = ios::in|ios::out); - virtual streambuf* setbuf(char* p, int len); - virtual int sync(); - virtual int doallocate(); - - int seekmark(streammarker& mark, int delta = 0); - int sputbackc(char c); - int sungetc(); - int unbuffered() { return _flags & 2 ? 1 : 0; } - int linebuffered() { return _flags & 0x200 ? 1 : 0; } - void unbuffered(int i) - { if (i) _flags |= 2 ; else _flags &= ~2 ; } - void linebuffered(int i) - { if (i) _flags |= 0x200 ; else _flags &= ~0x200 ; } - int allocate() { - if (base() || unbuffered()) return 0; - else return doallocate(); } - - void allocbuf() { if (base() == (__null) ) doallocbuf(); } - void doallocbuf(); - int in_avail() { return _IO_read_end - _IO_read_ptr; } - int out_waiting() { return _IO_write_ptr - _IO_write_base; } - streamsize sputn(const char* s, streamsize n) { return xsputn(s, n); } - streamsize padn(char pad, streamsize n) { return _IO_padn(this, pad, n); } - streamsize sgetn(char* s, streamsize n) { return _IO_sgetn(this, s, n); } - int ignore(int); - int get_column(); - int set_column(int); - long sgetline(char* buf, _G_size_t n, char delim, int putback_delim); - int sputc(int c) { return _IO_putc(c, this); } - int sbumpc() { return _IO_getc(this); } - int sgetc() { return (( this )->_IO_read_ptr >= ( this )->_IO_read_end && __underflow ( this ) == (-1) ? (-1) : *(unsigned char *) ( this )->_IO_read_ptr) ; } - int snextc() { - if (_IO_read_ptr >= _IO_read_end && __underflow(this) == (-1) ) - return (-1) ; - else return _IO_read_ptr++, sgetc(); } - void stossc() { if (_IO_read_ptr < _IO_read_end) _IO_read_ptr++; } - int vscan(char const *fmt0, _G_va_list ap, ios* stream = (__null) ); - int scan(char const *fmt0 ...); - int vform(char const *fmt0, _G_va_list ap); - int form(char const *fmt0 ...); - - - - - virtual streamsize sys_read(char* buf, streamsize size); - virtual streamsize sys_write(const char*, streamsize); - virtual streampos sys_seek(streamoff, _seek_dir); - virtual int sys_close(); - virtual int sys_stat(void*); -}; - - - - -class filebuf : public streambuf { - protected: - void init(); - public: - static const int openprot; - filebuf(); - filebuf(int fd); - filebuf(int fd, char* p, int len); - - - - ~filebuf(); - filebuf* attach(int fd); - filebuf* open(const char *filename, const char *mode); - filebuf* open(const char *filename, ios::openmode mode, int prot = 0664); - virtual int underflow(); - virtual int overflow(int c = (-1) ); - int is_open() const { return _fileno >= 0; } - int fd() const { return is_open() ? _fileno : (-1) ; } - filebuf* close(); - virtual int doallocate(); - virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out); - virtual streambuf* setbuf(char* p, int len); - streamsize xsputn(const char* s, streamsize n); - streamsize xsgetn(char* s, streamsize n); - virtual int sync(); - protected: - - int is_reading() { return eback() != egptr(); } - char* cur_ptr() { return is_reading() ? gptr() : pptr(); } - - char* file_ptr() { return eGptr(); } - - virtual streamsize sys_read(char* buf, streamsize size); - virtual streampos sys_seek(streamoff, _seek_dir); - virtual streamsize sys_write(const char*, streamsize); - virtual int sys_stat(void*); - virtual int sys_close(); - - - - -}; - -inline void ios::init(streambuf* sb, ostream* tie_to) { - _state = sb ? ios::goodbit : ios::badbit; _exceptions=0; - _strbuf=sb; _tie = tie_to; _width=0; _fill=' '; - - _flags=ios::skipws|ios::dec; - - - - _precision=6; _arrays = 0; } - -inline ios::ios(streambuf* sb, ostream* tie_to) { init(sb, tie_to); } - -inline ios::~ios() { - - - - operator delete(_arrays); -} -} - - - -extern "C++" { -class istream; class ostream; -typedef ios& (*__manip)(ios&); -typedef istream& (*__imanip)(istream&); -typedef ostream& (*__omanip)(ostream&); - -extern istream& ws(istream& ins); -extern ostream& flush(ostream& outs); -extern ostream& endl(ostream& outs); -extern ostream& ends(ostream& outs); - -class ostream : virtual public ios -{ - - void do_osfx(); - public: - ostream() { } - ostream(streambuf* sb, ostream* tied= (__null) ); - int opfx() { - if (!good()) return 0; - else { if (_tie) _tie->flush(); ; return 1;} } - void osfx() { ; - if (flags() & (ios::unitbuf|ios::stdio)) - do_osfx(); } - ostream& flush(); - ostream& put(char c) { _strbuf->sputc(c); return *this; } - - - - - - ostream& write(const char *s, streamsize n); - ostream& write(const unsigned char *s, streamsize n) - { return write((const char*)s, n);} - ostream& write(const signed char *s, streamsize n) - { return write((const char*)s, n);} - ostream& write(const void *s, streamsize n) - { return write((const char*)s, n);} - ostream& seekp(streampos); - ostream& seekp(streamoff, _seek_dir); - streampos tellp(); - ostream& form(const char *format ...); - ostream& vform(const char *format, _G_va_list args); - - ostream& operator<<(char c); - ostream& operator<<(unsigned char c) { return (*this) << (char)c; } - ostream& operator<<(signed char c) { return (*this) << (char)c; } - ostream& operator<<(const char *s); - ostream& operator<<(const unsigned char *s) - { return (*this) << (const char*)s; } - ostream& operator<<(const signed char *s) - { return (*this) << (const char*)s; } - ostream& operator<<(const void *p); - ostream& operator<<(int n); - ostream& operator<<(unsigned int n); - ostream& operator<<(long n); - ostream& operator<<(unsigned long n); - - __extension__ ostream& operator<<(long long n); - __extension__ ostream& operator<<(unsigned long long n); - - ostream& operator<<(short n) {return operator<<((int)n);} - ostream& operator<<(unsigned short n) {return operator<<((unsigned int)n);} - - ostream& operator<<(bool b) { return operator<<((int)b); } - - ostream& operator<<(double n); - ostream& operator<<(float n) { return operator<<((double)n); } - - - - ostream& operator<<(long double n) { return operator<<((double)n); } - - ostream& operator<<(__omanip func) { return (*func)(*this); } - ostream& operator<<(__manip func) {(*func)(*this); return *this;} - ostream& operator<<(streambuf*); - - - -}; - -class istream : virtual public ios -{ - -protected: - _G_size_t _gcount; - - int _skip_ws(); - public: - istream(): _gcount (0) { } - istream(streambuf* sb, ostream*tied= (__null) ); - istream& get(char* ptr, int len, char delim = '\n'); - istream& get(unsigned char* ptr, int len, char delim = '\n') - { return get((char*)ptr, len, delim); } - istream& get(char& c); - istream& get(unsigned char& c) { return get((char&)c); } - istream& getline(char* ptr, int len, char delim = '\n'); - istream& getline(unsigned char* ptr, int len, char delim = '\n') - { return getline((char*)ptr, len, delim); } - istream& get(signed char& c) { return get((char&)c); } - istream& get(signed char* ptr, int len, char delim = '\n') - { return get((char*)ptr, len, delim); } - istream& getline(signed char* ptr, int len, char delim = '\n') - { return getline((char*)ptr, len, delim); } - istream& read(char *ptr, streamsize n); - istream& read(unsigned char *ptr, streamsize n) - { return read((char*)ptr, n); } - istream& read(signed char *ptr, streamsize n) - { return read((char*)ptr, n); } - istream& read(void *ptr, streamsize n) - { return read((char*)ptr, n); } - istream& get(streambuf& sb, char delim = '\n'); - istream& gets(char **s, char delim = '\n'); - int ipfx(int need = 0) { - if (!good()) { set(ios::failbit); return 0; } - else { - ; - if (_tie && (need == 0 || rdbuf()->in_avail() < need)) _tie->flush(); - if (!need && (flags() & ios::skipws)) return _skip_ws(); - else return 1; - } - } - int ipfx0() { - if (!good()) { set(ios::failbit); return 0; } - else { - ; - if (_tie) _tie->flush(); - if (flags() & ios::skipws) return _skip_ws(); - else return 1; - } - } - int ipfx1() { - if (!good()) { set(ios::failbit); return 0; } - else { - ; - if (_tie && rdbuf()->in_avail() == 0) _tie->flush(); - return 1; - } - } - void isfx() { ; } - int get() { if (!ipfx1()) return (-1) ; - else { int ch = _strbuf->sbumpc(); - if (ch == (-1) ) set(ios::eofbit); - return ch; - } } - int peek(); - _G_size_t gcount() { return _gcount; } - istream& ignore(int n=1, int delim = (-1) ); - int sync (); - istream& seekg(streampos); - istream& seekg(streamoff, _seek_dir); - streampos tellg(); - istream& putback(char ch) { - if (good() && _strbuf->sputbackc(ch) == (-1) ) clear(ios::badbit); - return *this;} - istream& unget() { - if (good() && _strbuf->sungetc() == (-1) ) clear(ios::badbit); - return *this;} - istream& scan(const char *format ...); - istream& vscan(const char *format, _G_va_list args); - - - - - - - istream& operator>>(char*); - istream& operator>>(unsigned char* p) { return operator>>((char*)p); } - istream& operator>>(signed char*p) { return operator>>((char*)p); } - istream& operator>>(char& c); - istream& operator>>(unsigned char& c) {return operator>>((char&)c);} - istream& operator>>(signed char& c) {return operator>>((char&)c);} - istream& operator>>(int&); - istream& operator>>(long&); - - __extension__ istream& operator>>(long long&); - __extension__ istream& operator>>(unsigned long long&); - - istream& operator>>(short&); - istream& operator>>(unsigned int&); - istream& operator>>(unsigned long&); - istream& operator>>(unsigned short&); - - istream& operator>>(bool&); - - istream& operator>>(float&); - istream& operator>>(double&); - istream& operator>>(long double&); - istream& operator>>( __manip func) {(*func)(*this); return *this;} - istream& operator>>(__imanip func) { return (*func)(*this); } - istream& operator>>(streambuf*); -}; - -class iostream : public istream, public ostream -{ - public: - iostream() { } - iostream(streambuf* sb, ostream*tied= (__null) ); -}; - -class _IO_istream_withassign : public istream { -public: - _IO_istream_withassign& operator=(istream&); - _IO_istream_withassign& operator=(_IO_istream_withassign& rhs) - { return operator= (static_cast<istream&> (rhs)); } -}; - -class _IO_ostream_withassign : public ostream { -public: - _IO_ostream_withassign& operator=(ostream&); - _IO_ostream_withassign& operator=(_IO_ostream_withassign& rhs) - { return operator= (static_cast<ostream&> (rhs)); } -}; - -extern _IO_istream_withassign cin; - -extern _IO_ostream_withassign cout, cerr; - -extern _IO_ostream_withassign clog - - - -; - -extern istream& lock(istream& ins); -extern istream& unlock(istream& ins); -extern ostream& lock(ostream& outs); -extern ostream& unlock(ostream& outs); - -struct Iostream_init { } ; - -inline ios& dec(ios& i) -{ i.setf(ios::dec, ios::dec|ios::hex|ios::oct); return i; } -inline ios& hex(ios& i) -{ i.setf(ios::hex, ios::dec|ios::hex|ios::oct); return i; } -inline ios& oct(ios& i) -{ i.setf(ios::oct, ios::dec|ios::hex|ios::oct); return i; } -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#pragma interface - -#define _IOMANIP_H - - - -extern "C++" { - - - - - - - - -template<class TP> class smanip; - -template<class TP> class sapp { - ios& (*_f)(ios&, TP); -public: - sapp(ios& (*f)(ios&, TP)) : _f(f) {} - - smanip<TP> operator()(TP a) - { return smanip<TP>(_f, a); } -}; - -template<class TP> -inline istream& operator>>(istream& i, const smanip<TP>& m); -template<class TP> -inline ostream& operator<<(ostream& o, const smanip<TP>& m); - -template <class TP> class smanip { - ios& (*_f)(ios&, TP); - TP _a; -public: - smanip(ios& (*f)(ios&, TP), TP a) : _f(f), _a(a) {} - - friend - istream& operator>> <>(istream& i, const smanip<TP>& m); - friend - ostream& operator<< <>(ostream& o, const smanip<TP>& m); -}; - - -extern template class smanip<int>; -extern template class smanip<ios::fmtflags>; - - -template<class TP> -inline istream& operator>>(istream& i, const smanip<TP>& m) -{ (*m._f)(i, m._a); return i; } - -template<class TP> -inline ostream& operator<<(ostream& o, const smanip<TP>& m) -{ (*m._f)(o, m._a); return o;} - - -extern template istream& operator>>(istream&, const smanip<int>&); -extern template istream& operator>>(istream&, const smanip<ios::fmtflags>&); -extern template ostream& operator<<(ostream&, const smanip<int>&); -extern template ostream& operator<<(ostream&, const smanip<ios::fmtflags>&); - - - - - - -template<class TP> class imanip; - -template<class TP> class iapp { - istream& (*_f)(istream&, TP); -public: - iapp(istream& (*f)(istream&,TP)) : _f(f) {} - - imanip<TP> operator()(TP a) - { return imanip<TP>(_f, a); } -}; - -template <class TP> -inline istream& operator>>(istream&, const imanip<TP>&); - -template <class TP> class imanip { - istream& (*_f)(istream&, TP); - TP _a; -public: - imanip(istream& (*f)(istream&, TP), TP a) : _f(f), _a(a) {} - - friend - istream& operator>> <>(istream& i, const imanip<TP>& m); -}; - -template <class TP> -inline istream& operator>>(istream& i, const imanip<TP>& m) -{ return (*m._f)( i, m._a); } - - - - - -template<class TP> class omanip; - -template<class TP> class oapp { - ostream& (*_f)(ostream&, TP); -public: - oapp(ostream& (*f)(ostream&,TP)) : _f(f) {} - - omanip<TP> operator()(TP a) - { return omanip<TP>(_f, a); } -}; - -template <class TP> -inline ostream& operator<<(ostream&, const omanip<TP>&); - -template <class TP> class omanip { - ostream& (*_f)(ostream&, TP); - TP _a; -public: - omanip(ostream& (*f)(ostream&, TP), TP a) : _f(f), _a(a) {} - - friend - ostream& operator<< <>(ostream& o, const omanip<TP>& m); -}; - -template <class TP> -inline ostream& operator<<(ostream& o, const omanip<TP>& m) -{ return (*m._f)(o, m._a); } - - - - - - - - - -#define __DEFINE_IOMANIP_FN1(type,param,function) extern ios& __iomanip_##function (ios&, param); inline type<param> function (param n) { return type<param> (__iomanip_##function, n); } - - - - -extern ios& __iomanip_setbase (ios&, int ); inline smanip < int > setbase ( int n) { return smanip < int > (__iomanip_setbase , n); } -extern ios& __iomanip_setfill (ios&, int ); inline smanip < int > setfill ( int n) { return smanip < int > (__iomanip_setfill , n); } -extern ios& __iomanip_setprecision (ios&, int ); inline smanip < int > setprecision ( int n) { return smanip < int > (__iomanip_setprecision , n); } -extern ios& __iomanip_setw (ios&, int ); inline smanip < int > setw ( int n) { return smanip < int > (__iomanip_setw , n); } - -extern ios& __iomanip_resetiosflags (ios&, ios::fmtflags ); inline smanip < ios::fmtflags > resetiosflags ( ios::fmtflags n) { return smanip < ios::fmtflags > (__iomanip_resetiosflags , n); } -extern ios& __iomanip_setiosflags (ios&, ios::fmtflags ); inline smanip < ios::fmtflags > setiosflags ( ios::fmtflags n) { return smanip < ios::fmtflags > (__iomanip_setiosflags , n); } -} - - - - -#define LS_hh - - -#define Mouvement_hh - - - -#define usuel_hh - - - - - - -#define _MATH_H - - -extern "C" { - - -#pragma ident "@(#)math.h 2.5 95/02/07" - - - - - - - - - - - - - - - - - - -typedef union _h_val { - unsigned long _i[2]; - double _d; -} _h_val; - - -extern const _h_val __huge_val; - - - - - -#define HUGE_VAL __huge_val._d - - - - - - - -#define M_E 2.7182818284590452354 -#define M_LOG2E 1.4426950408889634074 -#define M_LOG10E 0.43429448190325182765 -#define M_LN2 0.69314718055994530942 -#define M_LN10 2.30258509299404568402 -#define M_PI 3.14159265358979323846 -#define M_PI_2 1.57079632679489661923 -#define M_PI_4 0.78539816339744830962 -#define M_1_PI 0.31830988618379067154 -#define M_2_PI 0.63661977236758134308 -#define M_2_SQRTPI 1.12837916709551257390 -#define M_SQRT2 1.41421356237309504880 -#define M_SQRT1_2 0.70710678118654752440 - -extern int signgam; - -#define MAXFLOAT ((float)3.40282346638528860e+38) - - - - - -enum version {libm_ieee = -1, c_issue_4, ansi_1, strict_ansi}; - - -extern const enum version _lib_version; - - - - - -#define exception __math_exception - -struct __math_exception { - -#undef exception - - int type; - char *name; - double arg1; - double arg2; - double retval; -}; - -#define HUGE MAXFLOAT - -#define _ABS(x) ((x) < 0 ? -(x) : (x)) - -#define _REDUCE(TYPE, X, XN, C1, C2) { double x1 = (double)(TYPE)X, x2 = X - x1; X = x1 - (XN) * (C1); X += x2; X -= (XN) * (C2); } - - - -#define DOMAIN 1 -#define SING 2 -#define OVERFLOW 3 -#define UNDERFLOW 4 -#define TLOSS 5 -#define PLOSS 6 - -#define _POLY1(x, c) ((c)[0] * (x) + (c)[1]) -#define _POLY2(x, c) (_POLY1((x), (c)) * (x) + (c)[2]) -#define _POLY3(x, c) (_POLY2((x), (c)) * (x) + (c)[3]) -#define _POLY4(x, c) (_POLY3((x), (c)) * (x) + (c)[4]) -#define _POLY5(x, c) (_POLY4((x), (c)) * (x) + (c)[5]) -#define _POLY6(x, c) (_POLY5((x), (c)) * (x) + (c)[6]) -#define _POLY7(x, c) (_POLY6((x), (c)) * (x) + (c)[7]) -#define _POLY8(x, c) (_POLY7((x), (c)) * (x) + (c)[8]) -#define _POLY9(x, c) (_POLY8((x), (c)) * (x) + (c)[9]) - - - - - - -extern double acos (double) ; -extern double asin (double) ; -extern double atan (double) ; -extern double atan2 (double, double) ; -extern double cos (double) ; -extern double sin (double) ; -extern double tan (double) ; - -extern double cosh (double) ; -extern double sinh (double) ; -extern double tanh (double) ; - -extern double exp (double) ; -extern double frexp (double, int *) ; -extern double ldexp (double, int) ; -extern double log (double) ; -extern double log10 (double) ; -extern double modf (double, double *) ; - -extern double pow (double, double) ; -extern double sqrt (double) ; - -extern double ceil (double) ; -extern double fabs (double) ; -extern double floor (double) ; -extern double fmod (double, double) ; - - - - - - -extern double erf (double) ; -extern double erfc (double) ; -extern double gamma (double) ; -extern double hypot (double, double) ; -extern int isnan (double) ; -extern double j0 (double) ; -extern double j1 (double) ; -extern double jn (int, double) ; -extern double lgamma (double) ; -extern double y0 (double) ; -extern double y1 (double) ; -extern double yn (int, double) ; - - - - - - -extern double acosh (double) ; -extern double asinh (double) ; -extern double atanh (double) ; -extern double cbrt (double) ; -extern double logb (double) ; -extern double nextafter (double, double) ; -extern double remainder (double, double) ; -extern double scalb (double, double) ; - - - - -extern double expm1 (double) ; -extern int ilogb (double) ; -extern double log1p (double) ; -extern double rint (double) ; - - - - - - - -#define exception __math_exception - -extern int matherr (struct __math_exception *) ; - -#undef exception - - - - - -extern double significand (double) ; - - - - -extern double copysign (double, double) ; -extern double scalbn (double, int) ; - - - - - - - - - - - - - -extern float modff (float, float *) ; - - - - - - - - - -#define _FLOATINGPOINT_H - - -extern "C" { - - -#pragma ident "@(#)floatingpoint.h 2.4 94/06/09" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#define _STDIO_H - -#pragma ident "@(#)stdio.h 1.39 95/12/04 SMI" - - - - - - - - - -#define _SYS_FEATURE_TESTS_H - -#pragma ident "@(#)feature_tests.h 1.7 94/12/06 SMI" - - -extern "C" { - - - - - - - - - - - - - - - -} - - - - - - - - - - -#define _SYS_VA_LIST_H - -#pragma ident "@(#)va_list.h 1.6 96/01/26 SMI" - - - - - - - - - - - - -extern "C" { - - - - - -typedef void *__va_list; - - - - - - - -} - - - - - - -extern "C" { - - - -#define _SIZE_T -typedef unsigned int size_t; - - -typedef long fpos_t; - - - - - - - - - - -#define BUFSIZ 1024 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#define _NFILE 20 - - - -#define _SBFSIZ 8 - -#define _IOFBF 0000 -#define _IOLBF 0100 -#define _IONBF 0004 -#define _IOEOF 0020 -#define _IOERR 0040 - -#define _IOREAD 0001 -#define _IOWRT 0002 -#define _IORW 0200 -#define _IOMYBUF 0010 - - - - - -#define FOPEN_MAX _NFILE -#define FILENAME_MAX 1024 - -#define SEEK_SET 0 -#define SEEK_CUR 1 -#define SEEK_END 2 -#define TMP_MAX 17576 - - - - -#define L_ctermid 9 -#define L_cuserid 9 - - - - - -#define P_tmpdir "/var/tmp/" - - -#define L_tmpnam 25 - - -#define stdin (&__iob[0]) -#define stdout (&__iob[1]) -#define stderr (&__iob[2]) - - - - - - -typedef struct -{ - - - - - int _cnt; - unsigned char *_ptr; - - unsigned char *_base; - unsigned char _flag; - unsigned char _file; -} FILE; - - -extern FILE __iob[20 ]; - - - -extern FILE *_lastbuf; -extern unsigned char *_bufendtab[]; - -extern unsigned char _sibuf[], _sobuf[]; - - - - -extern int remove(const char *); -extern int rename(const char *, const char *); -extern FILE *tmpfile(void); -extern char *tmpnam(char *); - - - -extern int fclose(FILE *); -extern int fflush(FILE *); -extern FILE *fopen(const char *, const char *); -extern FILE *freopen(const char *, const char *, FILE *); -extern void setbuf(FILE *, char *); -extern int setvbuf(FILE *, char *, int, size_t); - -extern int fprintf(FILE *, const char *, ...); - -extern int fscanf(FILE *, const char *, ...); - -extern int printf(const char *, ...); - -extern int scanf(const char *, ...); - -extern int sprintf(char *, const char *, ...); - -extern int sscanf(const char *, const char *, ...); -extern int vfprintf(FILE *, const char *, __va_list); -extern int vprintf(const char *, __va_list); -extern int vsprintf(char *, const char *, __va_list); -extern int fgetc(FILE *); -extern char *fgets(char *, int, FILE *); -extern int fputc(int, FILE *); -extern int fputs(const char *, FILE *); -extern int getc(FILE *); -extern int getchar(void); -extern char *gets(char *); -extern int putc(int, FILE *); -extern int putchar(int); -extern int puts(const char *); -extern int ungetc(int, FILE *); -extern size_t fread(void *, size_t, size_t, FILE *); -extern size_t fwrite(const void *, size_t, size_t, FILE *); -extern int fgetpos(FILE *, fpos_t *); -extern int fseek(FILE *, long, int); -extern int fsetpos(FILE *, const fpos_t *); -extern long ftell(FILE *); -extern void rewind(FILE *); -extern void clearerr(FILE *); -extern int feof(FILE *); -extern int ferror(FILE *); -extern void perror(const char *); - -extern int __filbuf(FILE *); -extern int __flsbuf(int, FILE *); - - - - - - - -extern FILE *fdopen(int, const char *); -extern char *ctermid(char *); -extern int fileno(FILE *); - - - - - - - - - - - - - -extern FILE *popen(const char *, const char *); -extern char *cuserid(char *); -extern char *tempnam(const char *, const char *); -extern int getopt(int, char *const *, const char *); - -extern int getsubopt(char **, char *const *, char **); - -extern char *optarg; -extern int optind, opterr, optopt; -extern int getw(FILE *); -extern int putw(int, FILE *); -extern int pclose(FILE *); - - - - - - - - - - - - - - - - - -#define getc(p) (--(p)->_cnt < 0 ? __filbuf(p) : (int)*(p)->_ptr++) -#define putc(x, p) (--(p)->_cnt < 0 ? __flsbuf((unsigned char) (x), (p)) : (int)(*(p)->_ptr++ = (x))) - - - - - - - -#define getchar() getc(stdin) -#define putchar(x) putc((x), stdout) -#define clearerr(p) ((void)((p)->_flag &= ~(_IOERR | _IOEOF))) -#define feof(p) ((p)->_flag & _IOEOF) -#define ferror(p) ((p)->_flag & _IOERR) - - - - -#define fileno(p) ((p)->_file) - - - - - - - -} - - - - - - - - - - -#define _SYS_IEEEFP_H - -#pragma ident "@(#)ieeefp.h 2.7 94/11/09" - - -extern "C" { - - - - - - -enum fp_direction_type { - fp_nearest = 0, - fp_tozero = 1, - fp_positive = 2, - fp_negative = 3 -}; - -enum fp_precision_type { - fp_extended = 0, - fp_single = 1, - fp_double = 2, - fp_precision_3 = 3 -}; - -enum fp_exception_type { - fp_inexact = 0, - fp_division = 1, - fp_underflow = 2, - fp_overflow = 3, - fp_invalid = 4 -}; - -enum fp_trap_enable_type { - fp_trap_inexact = 0, - fp_trap_division = 1, - fp_trap_underflow = 2, - fp_trap_overflow = 3, - fp_trap_invalid = 4 -}; - - - - - - -enum fp_class_type { - fp_zero = 0, - fp_subnormal = 1, - fp_normal = 2, - fp_infinity = 3, - fp_quiet = 4, - fp_signaling = 5 -}; - - -} - - - - - - - - - - - - - - - -#define N_IEEE_EXCEPTION 5 - -typedef int sigfpe_code_type; - -typedef void (*sigfpe_handler_type)(); - -#define SIGFPE_DEFAULT (void (*)())0 -#define SIGFPE_IGNORE (void (*)())1 -#define SIGFPE_ABORT (void (*)())2 - -extern sigfpe_handler_type sigfpe (sigfpe_code_type, sigfpe_handler_type) ; - - - - -typedef float single; - - -#define _EXTENDED -typedef unsigned extended[3]; - - -typedef long double quadruple; - -typedef unsigned fp_exception_field_type; - - - - - - - -#define DECIMAL_STRING_LENGTH 512 - -typedef char decimal_string[512 ]; - - -typedef struct { - enum fp_class_type fpclass; - int sign; - int exponent; - decimal_string ds; - - - int more; - - - int ndigits; - - -} decimal_record; - -enum decimal_form { - fixed_form, - - - floating_form - -}; - -typedef struct { - enum fp_direction_type rd; - - enum decimal_form df; - - int ndigits; -} decimal_mode; - -enum decimal_string_form { - invalid_form, - whitespace_form, - fixed_int_form, - fixed_intdot_form, - fixed_dotfrac_form, - fixed_intdotfrac_form, - floating_int_form, - floating_intdot_form, - floating_dotfrac_form, - floating_intdotfrac_form, - inf_form, - infinity_form, - nan_form, - nanstring_form -}; - -extern void single_to_decimal (single *, decimal_mode *, decimal_record *, - fp_exception_field_type *) ; -extern void double_to_decimal (double *, decimal_mode *, decimal_record *, - fp_exception_field_type *) ; -extern void extended_to_decimal (extended *, decimal_mode *, - decimal_record *, fp_exception_field_type *) ; -extern void quadruple_to_decimal (quadruple *, decimal_mode *, - decimal_record *, fp_exception_field_type *) ; - -extern void decimal_to_single (single *, decimal_mode *, decimal_record *, - fp_exception_field_type *) ; -extern void decimal_to_double (double *, decimal_mode *, decimal_record *, - fp_exception_field_type *) ; -extern void decimal_to_extended (extended *, decimal_mode *, - decimal_record *, fp_exception_field_type *) ; -extern void decimal_to_quadruple (quadruple *, decimal_mode *, - decimal_record *, fp_exception_field_type *) ; - -extern void string_to_decimal (char **, int, int, decimal_record *, - enum decimal_string_form *, char **) ; -extern void func_to_decimal (char **, int, int, decimal_record *, - enum decimal_string_form *, char **, - int (*)(void), int *, int (*)(int)) ; -extern void file_to_decimal (char **, int, int, decimal_record *, - enum decimal_string_form *, char **, - FILE *, int *) ; - -extern char *seconvert (single *, int, int *, int *, char *) ; -extern char *sfconvert (single *, int, int *, int *, char *) ; -extern char *sgconvert (single *, int, int, char *) ; -extern char *econvert (double, int, int *, int *, char *) ; -extern char *fconvert (double, int, int *, int *, char *) ; -extern char *gconvert (double, int, int, char *) ; -extern char *qeconvert (quadruple *, int, int *, int *, char *) ; -extern char *qfconvert (quadruple *, int, int *, int *, char *) ; -extern char *qgconvert (quadruple *, int, int, char *) ; - -extern char *ecvt (double, int, int *, int *) ; -extern char *fcvt (double, int, int *, int *) ; -extern char *gcvt (double, int, char *) ; - - - - - -extern double atof (const char *) ; -extern double strtod (const char *, char **) ; - - -} - - - - - - - - -} - - - - - - - - - - - - - - - - - - - - - - - - - -#pragma interface - -#define _String_h 1 - - - - - - - - - - - - - - - - - - - - - - - -#pragma interface - -#define _Regex_h 1 - - - - - - - -struct re_pattern_buffer; -struct re_registers; - -class Regex -{ -private: - - Regex(const Regex&) {} - void operator = (const Regex&) {} - -protected: - re_pattern_buffer* buf; - re_registers* reg; - -public: - Regex(const char* t, - int fast = 0, - int bufsize = 40, - const char* transtable = 0); - - ~Regex(); - - int match(const char* s, int len, int pos = 0) const; - int search(const char* s, int len, - int& matchlen, int startpos = 0) const; - int match_info(int& start, int& length, int nth = 0) const; - - int OK() const; -}; - - - - - - - - - - - - - - - - - - -struct StrRep -{ - unsigned short len; - unsigned short sz; - char s[1]; - - -}; - - - -StrRep* Salloc(StrRep*, const char*, int, int); -StrRep* Scopy(StrRep*, const StrRep*); -StrRep* Scat(StrRep*, const char*, int, const char*, int); -StrRep* Scat(StrRep*, const char*, int,const char*,int, const char*,int); -StrRep* Sprepend(StrRep*, const char*, int); -StrRep* Sreverse(const StrRep*, StrRep*); -StrRep* Supcase(const StrRep*, StrRep*); -StrRep* Sdowncase(const StrRep*, StrRep*); -StrRep* Scapitalize(const StrRep*, StrRep*); - - - -class String; -class SubString; - -class SubString -{ - friend class String; -protected: - - String& S; - unsigned short pos; - unsigned short len; - - void assign(const StrRep*, const char*, int = -1); - SubString(String& x, int p, int l); - -public: - SubString(const SubString& x); - - - - - ~SubString(); - - SubString& operator = (const String& y); - SubString& operator = (const SubString& y); - SubString& operator = (const char* t); - SubString& operator = (char c); - - - - int contains(char c) const; - int contains(const String& y) const; - int contains(const SubString& y) const; - int contains(const char* t) const; - int contains(const Regex& r) const; - - - - int matches(const Regex& r) const; - - - - friend ostream& operator<<(ostream& s, const SubString& x); - - - - unsigned int length() const; - int empty() const; - const char* chars() const; - - int OK() const; - -}; - - -class String -{ - friend class SubString; - -protected: - StrRep* rep; - - - - int search(int, int, const char*, int = -1) const; - int search(int, int, char) const; - int match(int, int, int, const char*, int = -1) const; - int _gsub(const char*, int, const char* ,int); - int _gsub(const Regex&, const char*, int); - SubString _substr(int, int); - -public: - - - - String(); - String(const String& x); - String(const SubString& x); - String(const char* t); - String(const char* t, int len); - String(char c); - - ~String(); - - String& operator = (const String& y); - String& operator = (const char* y); - String& operator = (char c); - String& operator = (const SubString& y); - - - - String& operator += (const String& y); - String& operator += (const SubString& y); - String& operator += (const char* t); - String& operator += (char c); - - void prepend(const String& y); - void prepend(const SubString& y); - void prepend(const char* t); - void prepend(char c); - - - - - - friend inline void cat(const String&, const String&, String&); - friend inline void cat(const String&, const SubString&, String&); - friend inline void cat(const String&, const char*, String&); - friend inline void cat(const String&, char, String&); - - friend inline void cat(const SubString&, const String&, String&); - friend inline void cat(const SubString&, const SubString&, String&); - friend inline void cat(const SubString&, const char*, String&); - friend inline void cat(const SubString&, char, String&); - - friend inline void cat(const char*, const String&, String&); - friend inline void cat(const char*, const SubString&, String&); - friend inline void cat(const char*, const char*, String&); - friend inline void cat(const char*, char, String&); - - - - - - friend inline void cat(const String&,const String&, const String&,String&); - friend inline void cat(const String&,const String&,const SubString&,String&); - friend inline void cat(const String&,const String&, const char*, String&); - friend inline void cat(const String&,const String&, char, String&); - friend inline void cat(const String&,const SubString&,const String&,String&); - inline friend void cat(const String&,const SubString&,const SubString&,String&); - friend inline void cat(const String&,const SubString&, const char*, String&); - friend inline void cat(const String&,const SubString&, char, String&); - friend inline void cat(const String&,const char*, const String&, String&); - friend inline void cat(const String&,const char*, const SubString&, String&); - friend inline void cat(const String&,const char*, const char*, String&); - friend inline void cat(const String&,const char*, char, String&); - - friend inline void cat(const char*, const String&, const String&,String&); - friend inline void cat(const char*,const String&,const SubString&,String&); - friend inline void cat(const char*,const String&, const char*, String&); - friend inline void cat(const char*,const String&, char, String&); - friend inline void cat(const char*,const SubString&,const String&,String&); - friend inline void cat(const char*,const SubString&,const SubString&,String&); - friend inline void cat(const char*,const SubString&, const char*, String&); - friend inline void cat(const char*,const SubString&, char, String&); - friend inline void cat(const char*,const char*, const String&, String&); - friend inline void cat(const char*,const char*, const SubString&, String&); - friend inline void cat(const char*,const char*, const char*, String&); - friend inline void cat(const char*,const char*, char, String&); - - - - - - - int index(char c, int startpos = 0) const; - int index(const String& y, int startpos = 0) const; - int index(const SubString& y, int startpos = 0) const; - int index(const char* t, int startpos = 0) const; - int index(const Regex& r, int startpos = 0) const; - - - - int contains(char c) const; - int contains(const String& y) const; - int contains(const SubString& y) const; - int contains(const char* t) const; - int contains(const Regex& r) const; - - - - - int contains(char c, int pos) const; - int contains(const String& y, int pos) const; - int contains(const SubString& y, int pos) const; - int contains(const char* t, int pos) const; - int contains(const Regex& r, int pos) const; - - - - int matches(char c, int pos = 0) const; - int matches(const String& y, int pos = 0) const; - int matches(const SubString& y, int pos = 0) const; - int matches(const char* t, int pos = 0) const; - int matches(const Regex& r, int pos = 0) const; - - - - int freq(char c) const; - int freq(const String& y) const; - int freq(const SubString& y) const; - int freq(const char* t) const; - - - - - - - - SubString at(int pos, int len); - SubString operator () (int pos, int len); - - SubString at(const String& x, int startpos = 0); - SubString at(const SubString& x, int startpos = 0); - SubString at(const char* t, int startpos = 0); - SubString at(char c, int startpos = 0); - SubString at(const Regex& r, int startpos = 0); - - SubString before(int pos); - SubString before(const String& x, int startpos = 0); - SubString before(const SubString& x, int startpos = 0); - SubString before(const char* t, int startpos = 0); - SubString before(char c, int startpos = 0); - SubString before(const Regex& r, int startpos = 0); - - SubString through(int pos); - SubString through(const String& x, int startpos = 0); - SubString through(const SubString& x, int startpos = 0); - SubString through(const char* t, int startpos = 0); - SubString through(char c, int startpos = 0); - SubString through(const Regex& r, int startpos = 0); - - SubString from(int pos); - SubString from(const String& x, int startpos = 0); - SubString from(const SubString& x, int startpos = 0); - SubString from(const char* t, int startpos = 0); - SubString from(char c, int startpos = 0); - SubString from(const Regex& r, int startpos = 0); - - SubString after(int pos); - SubString after(const String& x, int startpos = 0); - SubString after(const SubString& x, int startpos = 0); - SubString after(const char* t, int startpos = 0); - SubString after(char c, int startpos = 0); - SubString after(const Regex& r, int startpos = 0); - - - - - - void del(int pos, int len); - - - - void del(const String& y, int startpos = 0); - void del(const SubString& y, int startpos = 0); - void del(const char* t, int startpos = 0); - void del(char c, int startpos = 0); - void del(const Regex& r, int startpos = 0); - - - - int gsub(const String& pat, const String& repl); - int gsub(const SubString& pat, const String& repl); - int gsub(const char* pat, const String& repl); - int gsub(const char* pat, const char* repl); - int gsub(const Regex& pat, const String& repl); - - - - - - friend int split(const String& x, String res[], int maxn, - const String& sep); - friend int split(const String& x, String res[], int maxn, - const Regex& sep); - - friend String common_prefix(const String& x, const String& y, - int startpos = 0); - friend String common_suffix(const String& x, const String& y, - int startpos = -1); - friend String replicate(char c, int n); - friend String replicate(const String& y, int n); - friend String join(String src[], int n, const String& sep); - - - - friend inline String reverse(const String& x); - friend inline String upcase(const String& x); - friend inline String downcase(const String& x); - friend inline String capitalize(const String& x); - - - - void reverse(); - void upcase(); - void downcase(); - void capitalize(); - - - - char& operator [] (int i); - const char& operator [] (int i) const; - char elem(int i) const; - char firstchar() const; - char lastchar() const; - - - - operator const char*() const; - const char* chars() const; - - - - - friend inline ostream& operator<<(ostream& s, const String& x); - friend ostream& operator<<(ostream& s, const SubString& x); - friend istream& operator>>(istream& s, String& x); - - friend int readline(istream& s, String& x, - char terminator = '\n', - int discard_terminator = 1); - - - - unsigned int length() const; - int empty() const; - - - void alloc(int newsize); - - - - int allocation() const; - - - void error(const char* msg) const; - - int OK() const; -}; - -typedef String StrTmp; - - - -int compare(const String& x, const String& y); -int compare(const String& x, const SubString& y); -int compare(const String& x, const char* y); -int compare(const SubString& x, const String& y); -int compare(const SubString& x, const SubString& y); -int compare(const SubString& x, const char* y); -int fcompare(const String& x, const String& y); - -extern StrRep _nilStrRep; -extern String _nilString; - - - -inline unsigned int String::length() const { return rep->len; } -inline int String::empty() const { return rep->len == 0; } -inline const char* String::chars() const { return &(rep->s[0]); } -inline int String::allocation() const { return rep->sz; } - -inline unsigned int SubString::length() const { return len; } -inline int SubString::empty() const { return len == 0; } -inline const char* SubString::chars() const { return &(S.rep->s[pos]); } - - - - -inline String::String() - : rep(&_nilStrRep) {} -inline String::String(const String& x) - : rep(Scopy(0, x.rep)) {} -inline String::String(const char* t) - : rep(Salloc(0, t, -1, -1)) {} -inline String::String(const char* t, int tlen) - : rep(Salloc(0, t, tlen, tlen)) {} -inline String::String(const SubString& y) - : rep(Salloc(0, y.chars(), y.length(), y.length())) {} -inline String::String(char c) - : rep(Salloc(0, &c, 1, 1)) {} - -inline String::~String() { if (rep != &_nilStrRep) delete rep; } - -inline SubString::SubString(const SubString& x) - :S(x.S), pos(x.pos), len(x.len) {} -inline SubString::SubString(String& x, int first, int l) - :S(x), pos(first), len(l) {} - -inline SubString::~SubString() {} - - - -inline String& String::operator = (const String& y) -{ - rep = Scopy(rep, y.rep); - return *this; -} - -inline String& String::operator=(const char* t) -{ - rep = Salloc(rep, t, -1, -1); - return *this; -} - -inline String& String::operator=(const SubString& y) -{ - rep = Salloc(rep, y.chars(), y.length(), y.length()); - return *this; -} - -inline String& String::operator=(char c) -{ - rep = Salloc(rep, &c, 1, 1); - return *this; -} - - -inline SubString& SubString::operator = (const char* ys) -{ - assign(0, ys); - return *this; -} - -inline SubString& SubString::operator = (char ch) -{ - assign(0, &ch, 1); - return *this; -} - -inline SubString& SubString::operator = (const String& y) -{ - assign(y.rep, y.chars(), y.length()); - return *this; -} - -inline SubString& SubString::operator = (const SubString& y) -{ - assign(y.S.rep, y.chars(), y.length()); - return *this; -} - - - -inline void cat(const String& x, const String& y, String& r) -{ - r.rep = Scat(r.rep, x.chars(), x.length(), y.chars(), y.length()); -} - -inline void cat(const String& x, const SubString& y, String& r) -{ - r.rep = Scat(r.rep, x.chars(), x.length(), y.chars(), y.length()); -} - -inline void cat(const String& x, const char* y, String& r) -{ - r.rep = Scat(r.rep, x.chars(), x.length(), y, -1); -} - -inline void cat(const String& x, char y, String& r) -{ - r.rep = Scat(r.rep, x.chars(), x.length(), &y, 1); -} - -inline void cat(const SubString& x, const String& y, String& r) -{ - r.rep = Scat(r.rep, x.chars(), x.length(), y.chars(), y.length()); -} - -inline void cat(const SubString& x, const SubString& y, String& r) -{ - r.rep = Scat(r.rep, x.chars(), x.length(), y.chars(), y.length()); -} - -inline void cat(const SubString& x, const char* y, String& r) -{ - r.rep = Scat(r.rep, x.chars(), x.length(), y, -1); -} - -inline void cat(const SubString& x, char y, String& r) -{ - r.rep = Scat(r.rep, x.chars(), x.length(), &y, 1); -} - -inline void cat(const char* x, const String& y, String& r) -{ - r.rep = Scat(r.rep, x, -1, y.chars(), y.length()); -} - -inline void cat(const char* x, const SubString& y, String& r) -{ - r.rep = Scat(r.rep, x, -1, y.chars(), y.length()); -} - -inline void cat(const char* x, const char* y, String& r) -{ - r.rep = Scat(r.rep, x, -1, y, -1); -} - -inline void cat(const char* x, char y, String& r) -{ - r.rep = Scat(r.rep, x, -1, &y, 1); -} - -inline void cat(const String& a, const String& x, const String& y, String& r) -{ - r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), y.chars(), y.length()); -} - -inline void cat(const String& a, const String& x, const SubString& y, String& r) -{ - r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), y.chars(), y.length()); -} - -inline void cat(const String& a, const String& x, const char* y, String& r) -{ - r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), y, -1); -} - -inline void cat(const String& a, const String& x, char y, String& r) -{ - r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), &y, 1); -} - -inline void cat(const String& a, const SubString& x, const String& y, String& r) -{ - r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), y.chars(), y.length()); -} - -inline void cat(const String& a, const SubString& x, const SubString& y, String& r) -{ - r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), y.chars(), y.length()); -} - -inline void cat(const String& a, const SubString& x, const char* y, String& r) -{ - r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), y, -1); -} - -inline void cat(const String& a, const SubString& x, char y, String& r) -{ - r.rep = Scat(r.rep, a.chars(), a.length(), x.chars(), x.length(), &y, 1); -} - -inline void cat(const String& a, const char* x, const String& y, String& r) -{ - r.rep = Scat(r.rep, a.chars(), a.length(), x, -1, y.chars(), y.length()); -} - -inline void cat(const String& a, const char* x, const SubString& y, String& r) -{ - r.rep = Scat(r.rep, a.chars(), a.length(), x, -1, y.chars(), y.length()); -} - -inline void cat(const String& a, const char* x, const char* y, String& r) -{ - r.rep = Scat(r.rep, a.chars(), a.length(), x, -1, y, -1); -} - -inline void cat(const String& a, const char* x, char y, String& r) -{ - r.rep = Scat(r.rep, a.chars(), a.length(), x, -1, &y, 1); -} - - -inline void cat(const char* a, const String& x, const String& y, String& r) -{ - r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), y.chars(), y.length()); -} - -inline void cat(const char* a, const String& x, const SubString& y, String& r) -{ - r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), y.chars(), y.length()); -} - -inline void cat(const char* a, const String& x, const char* y, String& r) -{ - r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), y, -1); -} - -inline void cat(const char* a, const String& x, char y, String& r) -{ - r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), &y, 1); -} - -inline void cat(const char* a, const SubString& x, const String& y, String& r) -{ - r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), y.chars(), y.length()); -} - -inline void cat(const char* a, const SubString& x, const SubString& y, String& r) -{ - r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), y.chars(), y.length()); -} - -inline void cat(const char* a, const SubString& x, const char* y, String& r) -{ - r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), y, -1); -} - -inline void cat(const char* a, const SubString& x, char y, String& r) -{ - r.rep = Scat(r.rep, a, -1, x.chars(), x.length(), &y, 1); -} - -inline void cat(const char* a, const char* x, const String& y, String& r) -{ - r.rep = Scat(r.rep, a, -1, x, -1, y.chars(), y.length()); -} - -inline void cat(const char* a, const char* x, const SubString& y, String& r) -{ - r.rep = Scat(r.rep, a, -1, x, -1, y.chars(), y.length()); -} - -inline void cat(const char* a, const char* x, const char* y, String& r) -{ - r.rep = Scat(r.rep, a, -1, x, -1, y, -1); -} - -inline void cat(const char* a, const char* x, char y, String& r) -{ - r.rep = Scat(r.rep, a, -1, x, -1, &y, 1); -} - - - - -inline String& String::operator +=(const String& y) -{ - cat(*this, y, *this); - return *this; -} - -inline String& String::operator +=(const SubString& y) -{ - cat(*this, y, *this); - return *this; -} - -inline String& String::operator += (const char* y) -{ - cat(*this, y, *this); - return *this; -} - -inline String& String:: operator +=(char y) -{ - cat(*this, y, *this); - return *this; -} - - - - - -inline String operator + (const String& x, const String& y) return r; -{ - cat(x, y, r); -} - -inline String operator + (const String& x, const SubString& y) return r; -{ - cat(x, y, r); -} - -inline String operator + (const String& x, const char* y) return r; -{ - cat(x, y, r); -} - -inline String operator + (const String& x, char y) return r; -{ - cat(x, y, r); -} - -inline String operator + (const SubString& x, const String& y) return r; -{ - cat(x, y, r); -} - -inline String operator + (const SubString& x, const SubString& y) return r; -{ - cat(x, y, r); -} - -inline String operator + (const SubString& x, const char* y) return r; -{ - cat(x, y, r); -} - -inline String operator + (const SubString& x, char y) return r; -{ - cat(x, y, r); -} - -inline String operator + (const char* x, const String& y) return r; -{ - cat(x, y, r); -} - -inline String operator + (const char* x, const SubString& y) return r; -{ - cat(x, y, r); -} - -inline String reverse(const String& x) return r; -{ - r.rep = Sreverse(x.rep, r.rep); -} - -inline String upcase(const String& x) return r; -{ - r.rep = Supcase(x.rep, r.rep); -} - -inline String downcase(const String& x) return r; -{ - r.rep = Sdowncase(x.rep, r.rep); -} - -inline String capitalize(const String& x) return r; -{ - r.rep = Scapitalize(x.rep, r.rep); -} - - - - - -inline void String::prepend(const String& y) -{ - rep = Sprepend(rep, y.chars(), y.length()); -} - -inline void String::prepend(const char* y) -{ - rep = Sprepend(rep, y, -1); -} - -inline void String::prepend(char y) -{ - rep = Sprepend(rep, &y, 1); -} - -inline void String::prepend(const SubString& y) -{ - rep = Sprepend(rep, y.chars(), y.length()); -} - - - - -inline void String::reverse() -{ - rep = Sreverse(rep, rep); -} - - -inline void String::upcase() -{ - rep = Supcase(rep, rep); -} - - -inline void String::downcase() -{ - rep = Sdowncase(rep, rep); -} - - -inline void String::capitalize() -{ - rep = Scapitalize(rep, rep); -} - - - -inline char& String::operator [] (int i) -{ - if (((unsigned)i) >= length()) error("invalid index"); - return rep->s[i]; -} - -inline const char& String::operator [] (int i) const -{ - if (((unsigned)i) >= length()) error("invalid index"); - return rep->s[i]; -} - -inline char String::elem (int i) const -{ - if (((unsigned)i) >= length()) error("invalid index"); - return rep->s[i]; -} - -inline char String::firstchar() const -{ - return elem(0); -} - -inline char String::lastchar() const -{ - return elem(length() - 1); -} - - - -inline int String::index(char c, int startpos) const -{ - return search(startpos, length(), c); -} - -inline int String::index(const char* t, int startpos) const -{ - return search(startpos, length(), t); -} - -inline int String::index(const String& y, int startpos) const -{ - return search(startpos, length(), y.chars(), y.length()); -} - -inline int String::index(const SubString& y, int startpos) const -{ - return search(startpos, length(), y.chars(), y.length()); -} - -inline int String::index(const Regex& r, int startpos) const -{ - int unused; return r.search(chars(), length(), unused, startpos); -} - -inline int String::contains(char c) const -{ - return search(0, length(), c) >= 0; -} - -inline int String::contains(const char* t) const -{ - return search(0, length(), t) >= 0; -} - -inline int String::contains(const String& y) const -{ - return search(0, length(), y.chars(), y.length()) >= 0; -} - -inline int String::contains(const SubString& y) const -{ - return search(0, length(), y.chars(), y.length()) >= 0; -} - -inline int String::contains(char c, int p) const -{ - return match(p, length(), 0, &c, 1) >= 0; -} - -inline int String::contains(const char* t, int p) const -{ - return match(p, length(), 0, t) >= 0; -} - -inline int String::contains(const String& y, int p) const -{ - return match(p, length(), 0, y.chars(), y.length()) >= 0; -} - -inline int String::contains(const SubString& y, int p) const -{ - return match(p, length(), 0, y.chars(), y.length()) >= 0; -} - -inline int String::contains(const Regex& r) const -{ - int unused; return r.search(chars(), length(), unused, 0) >= 0; -} - -inline int String::contains(const Regex& r, int p) const -{ - return r.match(chars(), length(), p) >= 0; -} - - -inline int String::matches(const SubString& y, int p) const -{ - return match(p, length(), 1, y.chars(), y.length()) >= 0; -} - -inline int String::matches(const String& y, int p) const -{ - return match(p, length(), 1, y.chars(), y.length()) >= 0; -} - -inline int String::matches(const char* t, int p) const -{ - return match(p, length(), 1, t) >= 0; -} - -inline int String::matches(char c, int p) const -{ - return match(p, length(), 1, &c, 1) >= 0; -} - -inline int String::matches(const Regex& r, int p) const -{ - int l = (p < 0)? -p : length() - p; - return r.match(chars(), length(), p) == l; -} - - -inline int SubString::contains(const char* t) const -{ - return S.search(pos, pos+len, t) >= 0; -} - -inline int SubString::contains(const String& y) const -{ - return S.search(pos, pos+len, y.chars(), y.length()) >= 0; -} - -inline int SubString::contains(const SubString& y) const -{ - return S.search(pos, pos+len, y.chars(), y.length()) >= 0; -} - -inline int SubString::contains(char c) const -{ - return S.search(pos, pos+len, c) >= 0; -} - -inline int SubString::contains(const Regex& r) const -{ - int unused; return r.search(chars(), len, unused, 0) >= 0; -} - -inline int SubString::matches(const Regex& r) const -{ - return r.match(chars(), len, 0) == len; -} - - -inline int String::gsub(const String& pat, const String& r) -{ - return _gsub(pat.chars(), pat.length(), r.chars(), r.length()); -} - -inline int String::gsub(const SubString& pat, const String& r) -{ - return _gsub(pat.chars(), pat.length(), r.chars(), r.length()); -} - -inline int String::gsub(const Regex& pat, const String& r) -{ - return _gsub(pat, r.chars(), r.length()); -} - -inline int String::gsub(const char* pat, const String& r) -{ - return _gsub(pat, -1, r.chars(), r.length()); -} - -inline int String::gsub(const char* pat, const char* r) -{ - return _gsub(pat, -1, r, -1); -} - - - -inline ostream& operator<<(ostream& s, const String& x) -{ - s << x.chars(); return s; -} - - - -inline int operator==(const String& x, const String& y) -{ - return compare(x, y) == 0; -} - -inline int operator!=(const String& x, const String& y) -{ - return compare(x, y) != 0; -} - -inline int operator>(const String& x, const String& y) -{ - return compare(x, y) > 0; -} - -inline int operator>=(const String& x, const String& y) -{ - return compare(x, y) >= 0; -} - -inline int operator<(const String& x, const String& y) -{ - return compare(x, y) < 0; -} - -inline int operator<=(const String& x, const String& y) -{ - return compare(x, y) <= 0; -} - -inline int operator==(const String& x, const SubString& y) -{ - return compare(x, y) == 0; -} - -inline int operator!=(const String& x, const SubString& y) -{ - return compare(x, y) != 0; -} - -inline int operator>(const String& x, const SubString& y) -{ - return compare(x, y) > 0; -} - -inline int operator>=(const String& x, const SubString& y) -{ - return compare(x, y) >= 0; -} - -inline int operator<(const String& x, const SubString& y) -{ - return compare(x, y) < 0; -} - -inline int operator<=(const String& x, const SubString& y) -{ - return compare(x, y) <= 0; -} - -inline int operator==(const String& x, const char* t) -{ - return compare(x, t) == 0; -} - -inline int operator!=(const String& x, const char* t) -{ - return compare(x, t) != 0; -} - -inline int operator>(const String& x, const char* t) -{ - return compare(x, t) > 0; -} - -inline int operator>=(const String& x, const char* t) -{ - return compare(x, t) >= 0; -} - -inline int operator<(const String& x, const char* t) -{ - return compare(x, t) < 0; -} - -inline int operator<=(const String& x, const char* t) -{ - return compare(x, t) <= 0; -} - -inline int operator==(const SubString& x, const String& y) -{ - return compare(y, x) == 0; -} - -inline int operator!=(const SubString& x, const String& y) -{ - return compare(y, x) != 0; -} - -inline int operator>(const SubString& x, const String& y) -{ - return compare(y, x) < 0; -} - -inline int operator>=(const SubString& x, const String& y) -{ - return compare(y, x) <= 0; -} - -inline int operator<(const SubString& x, const String& y) -{ - return compare(y, x) > 0; -} - -inline int operator<=(const SubString& x, const String& y) -{ - return compare(y, x) >= 0; -} - -inline int operator==(const SubString& x, const SubString& y) -{ - return compare(x, y) == 0; -} - -inline int operator!=(const SubString& x, const SubString& y) -{ - return compare(x, y) != 0; -} - -inline int operator>(const SubString& x, const SubString& y) -{ - return compare(x, y) > 0; -} - -inline int operator>=(const SubString& x, const SubString& y) -{ - return compare(x, y) >= 0; -} - -inline int operator<(const SubString& x, const SubString& y) -{ - return compare(x, y) < 0; -} - -inline int operator<=(const SubString& x, const SubString& y) -{ - return compare(x, y) <= 0; -} - -inline int operator==(const SubString& x, const char* t) -{ - return compare(x, t) == 0; -} - -inline int operator!=(const SubString& x, const char* t) -{ - return compare(x, t) != 0; -} - -inline int operator>(const SubString& x, const char* t) -{ - return compare(x, t) > 0; -} - -inline int operator>=(const SubString& x, const char* t) -{ - return compare(x, t) >= 0; -} - -inline int operator<(const SubString& x, const char* t) -{ - return compare(x, t) < 0; -} - -inline int operator<=(const SubString& x, const char* t) -{ - return compare(x, t) <= 0; -} - - - - -inline SubString String::_substr(int first, int l) -{ - if (first < 0 || (unsigned)(first + l) > length() ) - return SubString(_nilString, 0, 0) ; - else - return SubString(*this, first, l); -} - - - - - -#define booleen_hh - - -typedef int booleen; - -const booleen VRAI=1; -const booleen FAUX=0; - - - - -#define valeur_bidon 12345678 - -#define fors(type, i, imin, imax) for(type i=imin; i< imax; i++) -#define fore(type, i, imin, imax) for(type i=imin; i<=imax; i++) - -void verif_nb_param(int argc, char* argv[], int nb_params); - -booleen f_exists(String nom); - - -template<class Type> -inline Type carre(const Type x) -{ - return x*x; -} - -template<class Type> -inline Type cube(const Type x) -{ - return x*x*x; -} - -template<class Type> -inline Type rac3(const Type x) -{ - if(fabs(x)<1E-5) - return 0; - else - if(x>0) - return exp(log(x)/3); - else - return -exp(log(-x)/3); -} - -template<class Type> -inline Type min(const Type a,const Type b) -{ - return (a>b)?b:a; -} - -template<class Type> -inline Type max(const Type a,const Type b) -{ - return (a<b)?b:a; -} - -template<class Type> -inline Type min(const Type a,const Type b,const Type c) -{ - return min(a,min(b,c)); -} - -template<class Type> -inline Type max(const Type a,const Type b,const Type c) -{ - return max(a,max(b,c)); -} - -template <class Type> -inline void echange(Type& a,Type& b) -{ - Type t=a; - a=b; - b=t; -} - - -String i2S(int n,int l=0); - -template <class Type> -inline booleen dans(Type x, Type a, Type b) -{ - return (a<=x) && (x<=b); -} - -template <class Type> -inline Type mabs(Type x) -{ - return (x<0) ? -x : x ; -} - -template <class Type> -inline booleen dans2(Type x, Type a, Type b) - -{ - return mabs(x-(a+b)/2) <= mabs((a-b)/2) ; -} - -template <class Type> -inline booleen proche(Type x, Type y, Type eps) -{ - return mabs(x-y)<eps; -} - -template <class Type> -inline int arrondi(Type x) -{ - return int(x+0.5); -} - -template<class Type> -unsigned char arrondi_ng(Type x) -{ - if((-0.5<x) && (x<255.5)) - return (unsigned char)(x+0.5); - else - { - if(x<-3.0 || x>268.0) - cerr<<"arrondi_ng : attention x= "<<x<<endl; - - if(x<0.0) - return 0; - else - return 255; - } -} - -template<class Type> -unsigned char arrondi_ng_err(Type x) -{ - if((-0.5<x) && (x<255.5)) - return (unsigned char)(x+0.5); - else - { - if(x<0.0) - return 0; - else - return 255; - } -} - -inline int nb_diff2(int a,int b) -{ - if(a==b) - return 1; - else - return 2; -} - -inline int nb_diff3(int a,int b,int c) -{ - if(a==b || a==c) - return nb_diff2(b,c); - else - return 1+nb_diff2(b,c); -} - -inline int nb_diff4(int a,int b,int c,int d) -{ - if(a==b || a==c || a==d) - return nb_diff3(b,c,d); - else - return 1+nb_diff3(b,c,d); -} - -float echMSB(float a); - -void plante(); -void arrete(); - -void touche(); - -template<class Type> -void lis_param(istream& f, Type& param) -{ - f>>param; - f.ignore(20000,'\n'); -} - -void lis_chaine(istream& s, String chaine); - -template<class Type_dest, class Type_source> -void convert(Type_dest& dest, const Type_source& source) -{ - dest=source; -} - - - - -struct Vect2Dent -{ - int di; - int dj; -}; - - - - - - -struct depl2D -{ - double x; - double y; - depl2D() : x(0.0), y(0.0) - { } - - - depl2D(double xx, double yy) : x(xx), y(yy) - { } - double amplitude() - { - return max(mabs(x),mabs(y)); - } -}; - -ostream& operator<<(ostream& s, depl2D m); - -class Mouvement -{ -private: - Mouvement* read_mv(istream& s); -protected: - double t_x; - double t_y; - double centre_x; - double centre_y; -public: - Mouvement(); - Mouvement(double i_t_x, double i_t_y, double i_centre_x, double i_centre_y); - virtual void Id()=0; - virtual void centre(double x,double y)=0; - virtual void applique(double& xx, double& yy, double x, double y) const=0; - virtual void applique(float& xx, float& yy, float x, float y) const=0; - virtual depl2D calc_depl(double x, double y)=0; - double Centre_x() const - { - return centre_x; - } - double Centre_y() const - { - return centre_y; - } - - virtual int nb_param() const=0; - - - virtual void init_from_vect_d(const double param[])=0; - virtual void init_vect_d(double param[]) const=0; - virtual void init_from_vect_f(const float param[])=0; - virtual void init_vect_f(float param[]) const=0; - - virtual Mouvement* clone() const=0; - virtual String nom() const=0; - virtual void dump(ostream& s) const=0; - - virtual booleen trop_grand(float seuil) const=0; - booleen trop_grand2(float seuil, float seuil_t) const; -}; - -ostream& operator<<(ostream& s, const Mouvement& m); -Mouvement* read_mv(istream& s); - - - - -class AFF; - -class LS : public Mouvement -{ -protected: - double k; - double theta; -public: - LS(); - LS(double i_t_x, double i_t_y, double i_k, double i_theta, double i_centre_x, double i_centre_y); - LS(istream& s); - LS(const AFF& aff); - int nb_param() const; - void update(double d_t_x, double d_t_y, double d_k, double d_theta); - void init_from_vect_d(const double param[]); - void init_vect_d(double param[]) const; - void init_from_vect_f(const float param[]); - void init_vect_f(float param[]) const; - friend class AFF; - void dump(ostream& s) const; -}; - -ostream& operator<<(ostream& s, const LS& m); - - - - -#define AFF_hh - - - -class LS; - -class AFF: public Mouvement -{ -protected: - double a; - double b; - double c; - double d; -public: - AFF(); - AFF(double i_t_x, double i_t_y, - double i_a, double i_b, double i_c, double i_d, - double i_centre_x, double i_centre_y); - AFF(istream& s); - AFF(const LS& ls); - int nb_param() const; - void init_from_vect_d(const double param[]); - void init_vect_d(double param[]) const; - void init_from_vect_f(const float param[]); - void init_vect_f(float param[]) const; - - friend class LS; - void dump(ostream& s) const; -}; - -ostream& operator<<(ostream& s, const AFF& m); - - - - - - - - - -LS::LS() : - k(0.0), theta(0.0) -{ } - -LS::LS(double i_t_x, double i_t_y, - double i_k, double i_theta, - double i_centre_x, double i_centre_y) : - Mouvement(i_t_x, i_t_y, i_centre_x, i_centre_y), - k(i_k), - theta(i_theta) -{ } - -LS::LS(istream& s) -{ - s>>k>>theta>>t_x>>theta>>k>>t_y>>centre_x>>centre_y; -} - -LS::LS(const AFF& aff): Mouvement(aff.t_x, aff.t_y, aff.centre_x, aff.centre_y) -{ - const double eps_k=1E-6; - if(mabs(aff.a-aff.d)>eps_k) - { - cout<<"AFF_2_LS : delta k < "<<eps_k<<endl; - cout<<aff.a<<endl<<aff.d<<endl; - plante(); - } - else - k=(aff.a+aff.d)/2; - - const double eps_theta=1E-6; - if(mabs(aff.c+aff.b)>eps_theta) - { - cout<<"AFF_2_LS : delta theta < "<<eps_theta<<endl; - plante(); - } - else - theta=(aff.c-aff.b)/2; -} - -int LS::nb_param() const -{ - return 4; -} - -void LS::update(double d_t_x, - double d_t_y, - double d_k, - double d_theta) -{ - t_x+=d_t_x; - t_y+=d_t_y; - k+=d_k; - theta+=d_theta; -} - -void LS::init_from_vect_d(const double param[]) -{ - t_x=param[0]; - t_y=param[1]; - k=param[2]; - theta=param[3]; -} - -void LS::init_vect_d(double param[]) const -{ - param[0]=t_x; - param[1]=t_y; - param[2]=k; - param[3]=theta; -} - -void LS::init_from_vect_f(const float param[]) -{ - t_x=param[0]; - t_y=param[1]; - k=param[2]; - theta=param[3]; -} - -void LS::init_vect_f(float param[]) const -{ - param[0]=t_x; - param[1]=t_y; - param[2]=k; - param[3]=theta; -} - - - - - - - - - - - - - - - -void LS::dump(ostream& s) const -{ - const int largeur=14; - s.setf(ios::left,ios::adjustfield); - s<<nom()<<endl - <<setw(largeur)<<k<<setw(largeur)<<-theta<<setw(largeur)<<t_x<<endl - <<setw(largeur)<<theta<<setw(largeur)<<k<<setw(largeur)<<t_y<<endl - <<centre_x<<' '<<centre_y<<endl; -} - -ostream& operator<<(ostream& s, const LS& m) -{ - m.dump(s); - return s; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb102.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb102.C deleted file mode 100644 index 9bbd47fdb33..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb102.C +++ /dev/null @@ -1,34 +0,0 @@ -// Error: intenral compiler error on 1998/05/28 snapshot. -#include <stdio.h> -#include <stdlib.h> - -void evilRises (void **ptr) -{ - int *pi; - - pi = new int; - - *pi = 0; - - *ptr = (void *)pi; -} - -int main (int argc, char *argv[]) -{ -#ifdef WORKAROUND - union foo -#else - union -#endif - { - int a; - int b; - int c; - } *fred, barney; - - evilRises((void **)&fred); - - barney = *fred; - - return EXIT_SUCCESS; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb103.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb103.C deleted file mode 100644 index ef25fb46634..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb103.C +++ /dev/null @@ -1,11 +0,0 @@ -// Build don't link: -// Error: Internal compiler error in 2.7.2 & EGCS 1.0.0 - -template <int nlimb, int i> -inline unsigned f (unsigned* ptr); -template <int nlimb> -inline unsigned f<nlimb,nlimb> (unsigned* ptr) -{ //ERROR - partial specialization of function? - return 1; -} - diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb104.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb104.C deleted file mode 100644 index 10c5945bb15..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb104.C +++ /dev/null @@ -1,29 +0,0 @@ -#include <string.h> - -class SomeClass_t { -public: - SomeClass_t () : x (11) {} -protected: - float x; -}; - -class DynamicOnly_t { -public: - static DynamicOnly_t* create (const char* name = "UNDEF", - const SomeClass_t& somec = *(new SomeClass_t -())) { - return new DynamicOnly_t (name, somec); - } - DynamicOnly_t (const char* name, const SomeClass_t& somec) : - m_somec (somec) { - strncpy (m_Name, name, sizeof (m_Name)); - } -private: - SomeClass_t m_somec; - char m_Name[255]; -}; - -int main (int argc, char* argv[]) { - DynamicOnly_t* ptr = DynamicOnly_t::create (); - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb105.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb105.C deleted file mode 100644 index f431fba88d8..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb105.C +++ /dev/null @@ -1,13 +0,0 @@ -// Build don't link: -template< class T > -void sort( T* t, int n ) - { - struct -/*line5*/ { - int operator()(T i, T j) - { - return (i < j) ? -1 : ((j < i) ? 1 : 0) ; - } - } c ; - sort(t, n, c, 0) ; - } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb106.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb106.C deleted file mode 100644 index 93631715869..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb106.C +++ /dev/null @@ -1,37 +0,0 @@ -// Skip if not native -// Special g++ Options: -O2 -fPIC -// Build don't link: -struct T -{ - char* f1; - int f2; -}; - -void f(T*); -int g(); - -extern char a1[]; - -inline int m(int a, int b) {return b < a ? 2 : 1;} - -void -h() -{ - T a[10]; - int i(0); - - bool c; - if (c) - { - a[i++].f1 = "asf"; - f(a); - i = 0; - } - - a[i].f1 = &a1[1]; - a[i].f2 = m(1, g()); - i++; - - a[i].f1 = "zxv"; - a[i].f2 = 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb107.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb107.C deleted file mode 100644 index 8d0f3cbe5b1..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb107.C +++ /dev/null @@ -1,20 +0,0 @@ -// Build don't link: -template <class T> -struct X -{ - virtual void f(int) const; -}; - -template <class T> -struct Y: public X<T> -{ - virtual void f(int) const; -}; - -template <class T> -void Y<T>::f(int) const -{ -} - -template <> -void Y<bool>::f(int) const; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb108.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb108.C deleted file mode 100644 index 3bf71b06dee..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb108.C +++ /dev/null @@ -1,21 +0,0 @@ -// Build don't link: -class X -{ - public: - virtual void f() const = 0; -}; - -template <class T> -class Y: public X -{ - public: - virtual void f() const; -}; - -template <class T> -void Y<T>::f() const -{ -} - -template <> -void Y<bool>::f() const; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C deleted file mode 100644 index ccd206b0e2c..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C +++ /dev/null @@ -1,71 +0,0 @@ -#include<map> -#include<iostream.h> -#include<vector> -#include<string> - -// empty parameter class with a minimal set of operations -// if there are no weights for edges necessary -struct Empty -{ - public: - Empty(int=0) {} - bool operator<(const Empty&) const { return true;} -}; -inline ostream& operator<<(ostream& os, const Empty&) { return os;} -inline istream& operator>>(istream& is, Empty& ) { return is;} - - -template<class VertexType, class EdgeType> -class Graph -{ - public: - // public type interface - typedef map<int, EdgeType > Successor; - typedef pair<VertexType, Successor> vertex; - typedef vector<vertex> GraphType; - typedef typename GraphType::iterator iterator; - typedef typename GraphType::const_iterator const_iterator; - - // a lot of stuff deleted .... - - private: - bool directed; - GraphType C; // container - ostream* pOut; -}; // ERROR - candidates - -// all graph-methods delet -template<class VertexType, class EdgeType> -ostream& operator<<(ostream& os, Graph<VertexType,EdgeType>& G) -{ - // display of vertices with successors - for(int i = 0; i < G.size(); ++i) // ERROR - no size function - { - os << G[i].first << " <"; // ERROR - no index operator - - // The compiler does not like this line!!!!!! - typename Graph<VertexType, EdgeType>::Successor::iterator - startN = G[i].second.begin(), // ERROR - no index operator - endN = G[i].second.end(); // ERROR - no index operator - - while(startN != endN) - { - os << G[(*startN).first].first << ' ' // vertex - << (*startN).second << ' '; // ERROR - no index operator - ++startN; - } - os << ">\n"; - } - return os; -} - -int main() -{ - // no edge weighting, therefore type Empty: - Graph<string, Empty> V(true); // ERROR - no bool constructor - // ReadGraph(V, "gra1.dat"); - - // display of vertices with successors - cout << V; - -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb11.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb11.C deleted file mode 100644 index 307aa6a9568..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb11.C +++ /dev/null @@ -1,29 +0,0 @@ -// Build don't link: - -template<int N1, int N2> -struct meta_max { - enum { max = (N1 > N2) ? N1 : N2 }; -}; - -struct X { - enum { - a = 0, - n = 0 - }; -}; - -template<class T1, class T2> -struct Y { - - enum { - a = T1::a + T2::a, - - // NB: if the next line is changed to - // n = (T1::n > T2::n) ? T1::n : T2::n - // the problem goes away. - - n = meta_max<T1::n,T2::n>::max - }; -}; - -int z = Y<X,X>::a; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb110.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb110.C deleted file mode 100644 index 54a1c8bbb86..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb110.C +++ /dev/null @@ -1,26 +0,0 @@ -// Build don't link: -class X -{ - public: - virtual void f() const = 0; -}; - -template <class T> -class Y: public X -{ - public: - virtual void f() const; -}; - -template <class T> -void Y<T>::f() const -{ -} - -template <> -void Y<bool>::f() const; - -template <> -void Y<bool>::f() const -{ -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb111.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb111.C deleted file mode 100644 index 8afc921e109..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb111.C +++ /dev/null @@ -1,6 +0,0 @@ - int main() { - for(int i=1; i < 9; i++); - for(int i=1; i < 9; i++); - - return 0; - } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb112.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb112.C deleted file mode 100644 index 3233287ff10..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb112.C +++ /dev/null @@ -1,12 +0,0 @@ -// Build don't link: -template <class STRUCT, class MEMBER> inline STRUCT * -setback(MEMBER *bp, MEMBER STRUCT::*offset) -{ - // The implementation of this function may be platform dependend - if(!bp) return 0; // NULL pointers remain NULL - union { int i; MEMBER STRUCT::*of; } u; // Switch types. Casting won't -+work. - u.of = offset; - return (STRUCT *) ((int) bp - u.i); -} - diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb113.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb113.C deleted file mode 100644 index f3c28b9ac65..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb113.C +++ /dev/null @@ -1,6 +0,0 @@ -// Build don't link: -#include <iostream.h> - -class X : public std::streambuf -{ -} ; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb114.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb114.C deleted file mode 100644 index 020b88bb775..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb114.C +++ /dev/null @@ -1,29 +0,0 @@ -#include <string.h> - -class SomeClass_t { -public: - SomeClass_t () : x (11) {} -protected: - float x; -}; - -class DynamicOnly_t { -public: - static DynamicOnly_t* create (const char* name = "UNDEF", - const SomeClass_t& somec = *(new SomeClass_t -())) { - return new DynamicOnly_t (name, somec); - } - DynamicOnly_t (const char* name, const SomeClass_t& somec) : - m_somec (somec) { - strncpy (m_Name, name, sizeof (m_Name)); - } -private: - SomeClass_t m_somec; - char m_Name[255]; -}; - -int main (int argc, char* argv[]) { - DynamicOnly_t* ptr = DynamicOnly_t::create (); //* - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb115.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb115.C deleted file mode 100644 index 30eab786f34..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb115.C +++ /dev/null @@ -1,9 +0,0 @@ -// Special g++ Options: -O - -#include <iostream.h> -#include <typeinfo> - -int main() { - int *i1, *i2; - cerr << (typeid(i1)==typeid(i2)) << endl; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb116.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb116.C deleted file mode 100644 index 63f5e79c062..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb116.C +++ /dev/null @@ -1,23 +0,0 @@ -template <class INT> -class b -{ -private: - char a(int x) - { - union { - int i; - char c; - } val; - val.i = x; - return val.c; - }; - -public: - b() { - } -}; - -int main() { - b<int> n; - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb118.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb118.C deleted file mode 100644 index 23498c78554..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb118.C +++ /dev/null @@ -1,37 +0,0 @@ -// Test for obsolete specialization syntax. Turn off -pedantic. -// Special g++ Options: - -#include <iostream.h> -#include <typeinfo> - -template <typename T> -class A { -public: - void test (); -}; - -template <typename T> -void -A<T>::test(){ - cerr << "test for " << typeid(*this).name() << endl; -} -// Specialization declaration -void -A<double>::test(); - -// Specialization definition -void -A<double>::test(){ - cerr << "specialization for " << typeid(*this).name() << endl; -} - - -int -main(){ - A<int> ai; - A<double> ad; - ai.test(); - ad.test(); - return 0; -} - diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb119.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb119.C deleted file mode 100644 index cecea834f8a..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb119.C +++ /dev/null @@ -1,10 +0,0 @@ -template<bool B> -void f() -{ -} - -int main() -{ - f<bool>(); // ERROR - .* -} - diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb12.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb12.C deleted file mode 100644 index 5c948f11b58..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb12.C +++ /dev/null @@ -1,32 +0,0 @@ -// Build don't link: -// Error: Internal Compiler Error in 2.7.2. & egcs 1.0.0 - -#ifndef NO_META_MAX -template<int N1, int N2> -struct meta_max { - enum { max = (N1 > N2) ? N1 : N2 }; -}; -#endif - -struct X { - enum { - a = 0, - n = 0 - }; -}; - -template<class T1, class T2> -struct Y { - - enum { - a = T1::a + T2::a, - - // NB: if the next line is changed to - // n = (T1::n > T2::n) ? T1::n : T2::n - // the problem goes away. - - n = meta_max<T1::n,T2::n>::max - }; -}; - -int z = Y<X,X>::a; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb120.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb120.C deleted file mode 100644 index b94820cdfec..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb120.C +++ /dev/null @@ -1,22 +0,0 @@ -template<double functionToIntegrate(double)> -double integrate(double a, double b, int numSamplePoints) -{ - // PRECONDITION(numSamplePoints > 1); - double delta = (b-a) / (numSamplePoints-1); - double sum = 0.; - for (int i=0; i < numSamplePoints; ++i) - sum += functionToIntegrate(a + i*delta); - return sum * (b-a) / numSamplePoints; -} - -inline double myFunction(double x) -{ - return 1 / (1 + x); -} - -// Example use -int main() { -double z = integrate<myFunction>(0.0, 1.0, 50); - return 0 ; -} - diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb121.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb121.C deleted file mode 100644 index 456615d67c5..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb121.C +++ /dev/null @@ -1,21 +0,0 @@ -//Build don't link: -class A { -private: - int i1_; -public: - void f(int const i1 = 1); // ERROR - previous specification -}; - -void -A::f(int const i1 = 1) -{ // ERROR - duplicate default argument - i1_ = i1; -} - -int -main() -{ - A a; - a.f(); - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb122.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb122.C deleted file mode 100644 index 9cf30333312..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb122.C +++ /dev/null @@ -1,10 +0,0 @@ -// Build don't link: -// Disable -ansi -pedantic-errors because of GNU extension -// Special g++ Options: -template<class foo> -class bar { -public: - void baz() { (({ while( foo::baz() );})); } -}; -template<class foo> -void baz() { (({ while( foo::baz() );})); } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb123.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb123.C deleted file mode 100644 index dd729d48ae9..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb123.C +++ /dev/null @@ -1,10 +0,0 @@ -// Special g++ Options: -O2 -W -// Build don't link: -#include "stdio.h" - -void writeNote() throw( int ) -{ - printf( "hello world\n" ); - try { } - catch( int ){ throw; } -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb124.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb124.C deleted file mode 100644 index c9c7395b5de..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb124.C +++ /dev/null @@ -1,3 +0,0 @@ -//Build don't link: -#include <stdexcept> -class X : public std::runtime_error {}; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb125.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb125.C deleted file mode 100644 index aff6ae61007..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb125.C +++ /dev/null @@ -1,23 +0,0 @@ -// This is a crash test; we don't care how many normal errors we get. -// excess errors test - XFAIL *-*-* - -struct test_box - { - void print(void); - }; - -void test<class BOX> (test_box *); // ERROR - illegal code - -class test_square - { - friend void test<class BOX> (test_box *); // ERROR - does not match - } - - - -template <class BOX> void test(BOX *the_box) // ERROR - semicolon missing - { - the_box->print(); - }; - -template void test<> (test_box *); diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb126.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb126.C deleted file mode 100644 index 8c634e87201..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb126.C +++ /dev/null @@ -1,29 +0,0 @@ -#include <string.h> - -class SomeClass_t { -public: - SomeClass_t () : x (11) {} -protected: - float x; -}; - -class DynamicOnly_t { -public: - static DynamicOnly_t* create (const char* name = "UNDEF", - const SomeClass_t& somec = *(new SomeClass_t -())) { - return new DynamicOnly_t (name, somec); - } - DynamicOnly_t (const char* name, const SomeClass_t& somec) : - m_somec (somec) { - strncpy (m_Name, name, sizeof (m_Name)); - } -private: - SomeClass_t m_somec; - char m_Name[255]; -}; - -int main (int argc, char* argv[]) { - DynamicOnly_t* ptr = DynamicOnly_t::create (); - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb127.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb127.C deleted file mode 100644 index cf5f69fc1a6..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb127.C +++ /dev/null @@ -1,59 +0,0 @@ -// Gets ICE 40. - -#include <vector> -#include<string> - -using namespace std; - -class ODEsolver -{ - private: - void eulerODE(vector<double>& y, double& t, double& dt); - void midpointODE(vector<double>& y, double& t, double& dt); - - protected: - void (ODEsolver::*useMethod)(vector<double>&, double&, double&); - void init(); - - public: - ODEsolver(); - void timeloop(vector<double>& y, double ts, double te, double dt); -}; - - -ODEsolver::ODEsolver() -{ - init(); -} - - -void ODEsolver::eulerODE(vector<double>& y, double& t, double& dt) -{ - y[0] = dt * 2.; -} - -void ODEsolver::midpointODE(vector<double>& y, double& t, double& dt) -{ - y[0] = dt * 3.; -} - - - -void ODEsolver::init() -{ - ODEsolver::useMethod = &ODEsolver::midpointODE; -} - -void ODEsolver::timeloop(vector<double>& y, double ts, double te, double dt) -{ - (ODEsolver::useMethod)(y,ts,dt); -} - -int main (int nargs, char** args) -{ - ODEsolver solver; - vector<double> y(2); double t_start=5.; double t_end=7.; double dt=2.; - solver.timeloop(y,t_start,t_end,dt); - cout << y[0] << endl; - return(0); -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb128.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb128.C deleted file mode 100644 index d056e39012e..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb128.C +++ /dev/null @@ -1,11 +0,0 @@ -template<class T> -struct A { - typedef T* iterator; // ERROR - pointer to reference -public: - A(){} -}; - -void f() -{ - A<int&> a; // ERROR - instantiated from here -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb129.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb129.C deleted file mode 100644 index a39d0c5b4cb..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb129.C +++ /dev/null @@ -1,22 +0,0 @@ -// Build don't link: -// Gives ICE on EGCS release branch as of 98/06/08 on i686-pc-linux-gnulibc1) -// From: Klaus-Georg Adams <Klaus-Georg.Adams@chemie.uni-karlsruhe.de> -// Message-Id: <199806081358.PAA02505@achibm5.chemie.uni-karlsruhe.de> -#include <list> -#include <functional> -#include <algorithm> -#include <cassert> -int main() -{ - list<int> l; - l.push_back(1); - l.push_back(2); - - list<int>::iterator it = - find_if( l.begin(), l.end(), - // This is a typo, it should be bind2nd, but an - // ICE is not a very helpful diagnostic! - binder2nd( equal_to<int>(), 2 ) ); // ERROR - - assert( *(it) == 2 ); -} - diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb13.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb13.C deleted file mode 100644 index f0e48484302..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb13.C +++ /dev/null @@ -1,16 +0,0 @@ -// Build don't link: -template<class T> -class Array { -public: - typedef T T_numtype; -}; - -template<class T_array> -void f(T_array, typename T_array::T_numtype) -{ -} - -void g() -{ - f(Array<float>(), float()); -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb130.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb130.C deleted file mode 100644 index 48bbb8f9898..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb130.C +++ /dev/null @@ -1,11 +0,0 @@ -// Build don't link: -// Gives spurious warnings when compiled with -Wall -// EGCS 06/08/98 i686-pc-linux-gnulibc1 -// Special g++ Options: -Wall -// Message-Id: <199806081358.PAA02505@achibm5.chemie.uni-karlsruhe.de> -// From: Klaus-Georg Adams <Klaus-Georg.Adams@chemie.uni-karlsruhe.de> - - -#include <hash_set> -std::hash_set<int> foo; - diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb131.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb131.C deleted file mode 100644 index d966fd9c01f..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb131.C +++ /dev/null @@ -1,20 +0,0 @@ -// Build don't link: -// From: Klaus-Georg Adams <Klaus-Georg.Adams@chemie.uni-karlsruhe.de> -// Reported against EGCS snaps 98/06/18. - -struct a { - a(); - void junk( float ); - void junk( double ); - - void bar( double ); - void bar( float ); - - void foo( void (a::*member)(float) ); // ERROR - candidate -}; - -a::a() -{ - foo( &junk ); // ERROR - junk is an unqualified-id. - foo( &bar ); // ERROR - bar is an unqualified-id. -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb132.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb132.C deleted file mode 100644 index 5b6bc6a5842..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb132.C +++ /dev/null @@ -1,28 +0,0 @@ -// Build don't link: -// From: Klaus-Georg Adams <Klaus-Georg.Adams@chemie.uni-karlsruhe.de> -// Reported against EGCS snaps 98/06/28. -// Special g++ Options: -O -Wall -fgcse -frerun-loop-opt -// -// Compilation of this program with the flags g++ -Wall -O -fgcse -// -frerun-loop-opt or -O2 produces spurious warnings in the standard -// header <std/bastring.h>. -// -// They vanish if the declaration of a::b is taken out. - -#include <string> - -string foo(); -struct a { - void bar(); - enum b { c, d }; - b theb; - string baz; -}; - -void -a::bar() -{ - baz += foo() + foo(); - baz += foo() + foo() + "foo"; -} - diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb133.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb133.C deleted file mode 100644 index 5ffdf9e6afe..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb133.C +++ /dev/null @@ -1,16 +0,0 @@ -// Build don't link: -// Gives ICE 109 -// From: Klaus-Georg Adams <Klaus-Georg.Adams@chemie.uni-karlsruhe.de> -// Reported against EGCS snaps 98/06/28. - -int main() -{ - try { - } - catch (bad_alloc) { // ERROR - parse error - return 1; - } - return 0; -} - - diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb14.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb14.C deleted file mode 100644 index de00e7baa6b..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb14.C +++ /dev/null @@ -1,36 +0,0 @@ -template<int N> -struct I { -}; - -template<class T> -struct A { - - int r; - - template<class T1, class T2> - void operator()(T1, T2) - { r = 0; } - - template<int N1, int N2> - void operator()(I<N1>, I<N2>) - { r = 1; } -}; - -int main() -{ - A<float> x; - I<0> a; - I<1> b; - - x(a,b); - if (x.r != 1) - abort(); - - x(float(), double()); - if (x.r != 0) - abort(); - - return 0; -} - - diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb15.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb15.C deleted file mode 100644 index 902d4631ac1..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb15.C +++ /dev/null @@ -1,25 +0,0 @@ -// Build don't link: -#include<iostream.h> -#include<stddef.h> - -struct A { - A() { - cerr<<"A constructing\n"; - throw 1; - } - void *operator new(size_t sz) { - cerr<<"A allocated\n"; - return ::operator new(sz); - } - void operator delete (void *p) { - cerr<<"A deleted\n"; - ::operator delete (p); - } -}; - -int main() { - try { - new A(); - } catch (...) { - } -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb16.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb16.C deleted file mode 100644 index 5dc259d2822..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb16.C +++ /dev/null @@ -1,14 +0,0 @@ -// Build don't link: -template<class T> -struct A { - typedef T T1; -}; - -template<class T> -struct B : T::T1 { // insert `typename' before T::T1 -}; - -struct C { }; - -B<A<C> > z; - diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb17.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb17.C deleted file mode 100644 index f32dadba9a5..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb17.C +++ /dev/null @@ -1,56 +0,0 @@ -// excess errors test - XFAIL -// covariant return types in are currently not support for complex inheritance -#include <stdio.h> - -class A { -public: - virtual void print(); - virtual A * clone(); -}; - -class B : virtual public A { -public: - void print(); - B * clone(); -}; - -void A::print() -{ - printf("A\n"); -} - -void B::print() -{ - printf("B\n"); -} - - -A * A::clone() -{ - return this; -} - -B * B::clone() -{ - return this; -} - - -int main() -{ - A * a = new B; - B * b = dynamic_cast<B *>(a); - - printf("%p\n",b); // (*2*) - b->print(); - - a = b; - printf("%p\n",a); - a->print(); - - a = a->clone(); - printf("%p\n",a); - a->print(); // (*1*) - - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb18.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb18.C deleted file mode 100644 index fd953fe0710..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb18.C +++ /dev/null @@ -1,8 +0,0 @@ -// Build don't link: -class C { }; - -void foo() -{ - C c; - void * v = static_cast<void *>(c); // ERROR - illegal cast -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb19.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb19.C deleted file mode 100644 index a5ddd36c7bd..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb19.C +++ /dev/null @@ -1,16 +0,0 @@ -// Build don't link: - -#define CRASH 1 -#ifdef CRASH -#define VIRTUAL virtual -#else -#define VIRTUAL -#endif - -class A {}; -class B : public VIRTUAL A {}; -template <class Imp> class C : public /*virtual*/ Imp {}; -// define CRASH and uncomment here ^^^^^^^^^^^ -// and the crash goes away!!!! - -template class C<B>; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb2.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb2.C deleted file mode 100644 index b20002121a1..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb2.C +++ /dev/null @@ -1,17 +0,0 @@ -// Build don't link: -typedef __SIZE_TYPE__ size_t; -inline void *operator new(size_t, void *place) throw() { return place; } - -struct A -{ - A(); - ~A(); -}; - -void testfunc( void ) -{ - A* mybuf; - A v[1]; - - new (mybuf) A(); -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb20.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb20.C deleted file mode 100644 index 08c76d0f97e..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb20.C +++ /dev/null @@ -1,33 +0,0 @@ -// Error: ICE on 2.7.2.3 and EGCS 1.0.0. -// Build don't link: - -template<int N1, int N2> -struct meta_max { - enum { max = (N1 > N2) ? N1 : N2 }; -}; - -struct X { - enum { - a = 0, - n = 0 - }; -}; - -template<class T1, class T2, class T3> -struct Y { - - enum { - a = T1::a + T2::a + T3::a, - n = meta_max<meta_max<T1::n,T2::n>::max, T3::n>::max - }; -}; - -template<class T> -struct Z { - enum { - a = T::a, - n = T::n - }; -}; - -Z<Y<X,X,X> > z; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb21.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb21.C deleted file mode 100644 index b3468d9e82f..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb21.C +++ /dev/null @@ -1,22 +0,0 @@ -#include <vector> - -#include <strstream.h> - -/*----------------------------------------*/ - -struct connection_t { - connection_t() {} -}; - -vector<connection_t> connections; - -/*----------------------------------------*/ - -int -main() { - ostrstream str; - - connections.insert(connections.end(), connection_t()); - - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb22.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb22.C deleted file mode 100644 index bfe513b46db..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb22.C +++ /dev/null @@ -1,26 +0,0 @@ -// Ambiguous conversion, three candidates: -// builtin == (int, int), and the two user-defined operators -// Each one requires a user-defined ICS where another uses builtin conversions, -// so none is the best viable function. - -class MyInt -{ -public: - MyInt(int = 0) {} - operator int() const {return 2;} -}; - -bool operator==(const MyInt& a, const int& b) -{ // ERROR - candidate - return (int)a == b; -} - -bool operator==(const MyInt& a, const MyInt& b) -{ // ERROR - candidate - return (int)a == (int)b; -} - -bool f() -{ - return 3 == MyInt(); // ERROR - ambiguous -} // ERROR - no return value diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb23.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb23.C deleted file mode 100644 index 8a0602a8235..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb23.C +++ /dev/null @@ -1,20 +0,0 @@ -// Build don't link: -class foo { -protected: - void __duplicate (); - -}; - -class bar : public virtual foo { -protected: - void __duplicate() { - foo::__duplicate (); - } -}; - -class oops : public virtual bar { -protected: - void __duplicate() { - foo::__duplicate (); - } -}; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb24.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb24.C deleted file mode 100644 index b1f01043817..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb24.C +++ /dev/null @@ -1,23 +0,0 @@ -// Build don't link: -#include <iostream.h> - -template < class T > -class X -{ - protected: - - union { - int x; - double y; - }; -}; - -template < class T > -class Y : public X<T> -{ - public: - - using X<T>::x; - - void f () { cout << x << endl; } -}; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb26.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb26.C deleted file mode 100644 index 2374b557346..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb26.C +++ /dev/null @@ -1,30 +0,0 @@ -// -// egcs-2.90.06 -// cannot declare friend of enclosing class using its scope, works fine -// without scope or for definition of foo::bar::f -// - -class foo -{ -public: - static int f(); - class bar { - friend int foo::f(); -// friend int f(); - static int x; - public: - static int f() {return foo::f();}; - }; -}; - -int foo::bar::x; - -int foo::f() { - return bar::x; -} - -int -main () -{ - return foo::bar::f (); -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb27.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb27.C deleted file mode 100644 index 9e44f3af8b9..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb27.C +++ /dev/null @@ -1,39 +0,0 @@ -/* bug.cc */ -/* simple program to demonstrate the bug with named return values in gcc -*/ -/* (w) 4.9.97 by Kurt Garloff <K.Garloff@ping.de> */ -// Special g++ Options: -// 8/28/1998 - This dies in add_conversions from dfs_walk, null CLASSTYPE_METHOD_VEC -// for the test<T> record_type. This is marked as an expected failure for now, -// until we actually fix it. - -#include <iostream.h> - -template <class T> class test; -template <class T> test<T> operator + (const test<T>& a, const test<T>& b); - -// A simple numerical class -template <class T> -class test -{ - T elem; - public: - test () { elem = 0; }; - test (const T& a) { elem = a; }; - test<T>& operator += (const test<T>& a) { elem += a.elem; return *this; }; - friend test<T> operator + <> (const test<T>&, const test<T>&); - friend ostream& operator << (ostream& os, const test<T>& a) - { return os << a.elem; }; -}; - -// named return value version -template <class T> -test<T> operator + (const test<T>& a, const test<T>& b) return c(a); -{ c += b; }; - -int main() -{ - test<int> x, y; - x += 5; cout << x << endl; - y = x + test<int>(2); cout << y << endl; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb28.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb28.C deleted file mode 100644 index 6c3130eafa5..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb28.C +++ /dev/null @@ -1,17 +0,0 @@ -//Build don't link: -#include <vector.h> -enum s { S }; -class a -{ - vector<s> vs; - friend class b; -}; -struct b -{ - vector<a> va; - operator vector< vector<s> >() - { - vector< vector<s> > vvs(va.size()); - return vvs; - } -}; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb29.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb29.C deleted file mode 100644 index f1017a774a7..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb29.C +++ /dev/null @@ -1,16 +0,0 @@ -//Build don't link: -#include <vector.h> -enum s { S }; -class a -{ - vector<s> vs; - friend class b; -}; -struct b -{ - vector<a> va; - operator vector< vector<s> >() - { - return vector< vector<s> >(va.size()); - } -}; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb3.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb3.C deleted file mode 100644 index d257043e46a..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb3.C +++ /dev/null @@ -1,11 +0,0 @@ -// Build don't link: -#include <complex.h> -template<class T> -class Vec { -public: - Vec() { data = new T; } - Vec<T> split() { Vec<T> tmp; operator=(tmp); return tmp; } - void operator=(const Vec<T> &v) { data = new T; } - T *data; -}; -template class Vec<complex<double> >; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb30.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb30.C deleted file mode 100644 index c116ab4cd4d..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb30.C +++ /dev/null @@ -1,16 +0,0 @@ -// Build don't link: -#include <fstream.h> - -class bifstream : public ifstream { -public: - bifstream(); -// ~bifstream(); -}; - -void load_bin() -{ - bifstream InFile; - - if (!InFile) - return; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb31.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb31.C deleted file mode 100644 index 1a18af5b4c8..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb31.C +++ /dev/null @@ -1,17 +0,0 @@ -#include<iostream.h> - -int main() { - try { - throw 1; - } catch(...) { - try { - throw; - } catch(int) { - } - try { - throw; - } catch(int) { - } - } - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb32.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb32.C deleted file mode 100644 index 95e16178298..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb32.C +++ /dev/null @@ -1,12 +0,0 @@ -// Build don't link: -class A { -public: - void malloc(unsigned int); -}; - -void A::malloc(unsigned int) {} - -void foo() { - A a; - a.malloc(3); // <-- line 10 -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb33.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb33.C deleted file mode 100644 index 3797ab3740f..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb33.C +++ /dev/null @@ -1,11 +0,0 @@ -#include <fstream.h> -#include <stdio.h> - -int -main() -{ - printf("If you see this, you don't have a problem!\n"); -#ifdef EXPOSE_BUG - ifstream a; -#endif -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb34.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb34.C deleted file mode 100644 index 08167b5d981..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb34.C +++ /dev/null @@ -1,19 +0,0 @@ -// Build don't link: -class Base { -public: - class Bar { public: virtual ~Bar() {}; }; -}; - -class Derived : public Base { -public: - class Bar : public Base::Bar {}; -}; - -template <class T> -class XYZ : public T::Bar { -}; - -void test() { - XYZ<Base> b; - XYZ<Derived> d; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb35.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb35.C deleted file mode 100644 index e28fb4925f6..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb35.C +++ /dev/null @@ -1,38 +0,0 @@ -// Build don't link: - -class string -{ -public: - string(); - string(const string& x); - string(const char* t); - - ~string(); -}; - -void set_status(string message); - -class StatusDelay { -private: - string cause; - -public: - StatusDelay(const string& c) - : cause(c) - { - set_status(cause); - } - - ~StatusDelay() - { - set_status(cause); - } -}; - -static char delay_message[] = "Filtering files"; - -static void searchRemote() -{ - StatusDelay delay(delay_message); - return; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb36.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb36.C deleted file mode 100644 index 415e5bdf6f4..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb36.C +++ /dev/null @@ -1,17 +0,0 @@ -#include <vector> - -template <typename T=float> class foo { -public: - foo(); - foo(vector<int> v); -private: - vector<int> v; - T t; -}; - -template <typename T> -foo<T>::foo() :v(), t() {} -template <typename T=float> -foo<T>::foo(vector<int> v_) :v(v_), t() {} // ERROR - default arg for member template - -foo<float> a; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb37.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb37.C deleted file mode 100644 index be4b57d8751..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb37.C +++ /dev/null @@ -1,26 +0,0 @@ -// Build don't link: -template<class T> -struct A { - typedef T T1; -}; - -template<class T> -struct B { - typedef T T2; -}; - -template<class T> -struct C { -}; - -template<class E> -C<typename E::T2::T1> -foo (E) -{ - return C<typename E::T2::T1>(); -} - -void test() -{ - foo(B<A<int> >()); -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb38.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb38.C deleted file mode 100644 index 9a75405d129..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb38.C +++ /dev/null @@ -1,37 +0,0 @@ -// Build don't link: -class string -{ -public: - string(); - string(const string& x); - string(const char* t); - - ~string(); -}; - -void set_status(string message); - -class StatusDelay { -private: - string cause; - -public: - StatusDelay(const string& c) - : cause(c) - { - set_status(cause); - } - - ~StatusDelay() - { - set_status(cause); - } -}; - -static char delay_message[] = "Filtering files"; - -static void searchRemote() -{ - StatusDelay delay(delay_message); - return; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb39.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb39.C deleted file mode 100644 index feefca77ad9..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb39.C +++ /dev/null @@ -1,16 +0,0 @@ -// Build don't link: -#include <ctype.h> -#include <iostream.h> -// #include <streambuf.h> -#include <libio.h> -#include <strstream.h> - -extern bool foo2 (ostream &out, istream &in); - -bool -foo1 (ostream &out, const char *in) -{ - strstreambuf sb (in, (int) strlen (in)); - istream fmt (&sb); - return foo2 (out, fmt); -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb4.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb4.C deleted file mode 100644 index b51d3eafb98..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb4.C +++ /dev/null @@ -1,48 +0,0 @@ -// Error: Internal Compiler Error in GCC 2.7.2 and EGCS 1998/05/28 snapshot. - -#include <iostream.h> - -class some_base - { -public: - class base_func_args; - virtual void func(base_func_args &) = 0; // ERROR - referenced below - }; - -class some_base::base_func_args - { -public: - int i; - }; - -class some_derived : public some_base - { -public: - class derived_func_args; - void func(derived_func_args &); - }; - - -class derived_func_args : public some_base::base_func_args - { -public: - float f; - }; - -class some_derived::func(derived_func_args &a) // ERROR - illegal member syntax - { - cout << a.i << ' ' << a.f << endl; - } - -int -main() - { - some_derived d; // ERROR - abstract class - some_derived::derived_func_args dfa; // ERROR - incomplete class - some_base *b = &d; - - dfa.i = 10; - dfa.f = 20; - b->func(dfs); // ERROR - dfs not declared - return 0; - } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb41.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb41.C deleted file mode 100644 index 3c97e01844e..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb41.C +++ /dev/null @@ -1,13 +0,0 @@ -#include <iostream.h> -#include <iterator.h> -#include <string> - -ostream_iterator<string> oo(cout); - -int main() -{ - *oo = "Hello, "; - ++oo; - *oo = "world!\n"; -} - diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb43.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb43.C deleted file mode 100644 index 7f8647226c8..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb43.C +++ /dev/null @@ -1,38 +0,0 @@ -// All the pointer_to_binary_function cases used to fail because g++ -// couldn't handle converting an overloaded function to a class type. -// The first one should still fail because it requires an implicit conversion -// to pointer_to_binary_function, which has an `explicit' constructor. - -#include <vector.h> -#include <algo.h> - -template <class T> class Expr -{ -public : - Expr(){}; - Expr(const T&){}; -}; - -template <class T > -inline bool compare(const Expr<T> a, const Expr<T> b){ return true; }; - -int main() -{ - vector<int> a(3); - sort( a.begin(), a.end(), - static_cast<bool (*)(const Expr<int>,const Expr<int>)>(compare) ); - sort( a.begin(), a.end(), compare<int> ); - sort<vector<int>::iterator, - pointer_to_binary_function<const Expr<int>, const Expr<int>, bool> > - ( a.begin(), a.end(), compare ); // ERROR - constructor is explicit - sort( a.begin(), a.end(), - ptr_fun<const Expr<int>, const Expr<int>, bool> (compare) ); - sort( a.begin(), a.end(), - ptr_fun(compare<int>) ); - sort( a.begin(), a.end(), - pointer_to_binary_function<const Expr<int>, const Expr<int>, bool>(compare) ); - sort( a.begin(), a.end(), - pointer_to_binary_function<const Expr<int>, const Expr<int>, bool>(compare<int>) ); - sort( a.begin(), a.end(), - pointer_to_binary_function<const Expr<int>, const Expr<int>, bool>(compare<>) ); -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb44.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb44.C deleted file mode 100644 index 54eab153609..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb44.C +++ /dev/null @@ -1,35 +0,0 @@ -// spurious 'const' in error. -// For egcs-2.91.34, the warning message refers to -// class ostream & operator <<(class ostream &, const class Vector<T> &) -// Also, the template instantiation does not provide the missing -// friend function, the non-template function does - -#include <stdio.h> -#include <iostream.h> - -template <class T> -class Vector -{ - friend ostream& operator<< (ostream& out, const Vector<T> & vec); // WARNING - -}; - -template <class T> -ostream& operator<< (ostream& out, const Vector<T> & vec) -{ - abort(); // this should not be called -} - -template class Vector<char>; -template ostream& operator<< (ostream& out, const Vector<char> &); - -ostream& operator<< (ostream& out, const Vector<char>&) -{ - return out; -} - -int main() -{ - Vector<char> vc; - ostream out; - out << vc; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb45.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb45.C deleted file mode 100644 index 9e2642c2a42..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb45.C +++ /dev/null @@ -1,6 +0,0 @@ -// Build don't link: -class A {}; -class B : public virtual A {}; -template <class Imp> class C : public Imp {}; - -template class C<B>; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb46.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb46.C deleted file mode 100644 index ad077e38dc3..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb46.C +++ /dev/null @@ -1,27 +0,0 @@ -#include <iostream.h> - -class A1 { - friend class B; - public: - virtual void foo() {}; -}; - -class A2 : public virtual A1 {friend class B;}; - -class A3 : public virtual A1, private A2 {friend class B;}; - -class B -{ - public: - B(A1* a) : itsA(dynamic_cast<A2*>(a)) {}; - A2* itsA; -}; - -int main() -{ - A1* a=new A3; - B b(a); - - if (b.itsA) cout << "cast ok" << endl; else cout << "cast failed" << endl; - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb48.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb48.C deleted file mode 100644 index 1d10bed5c03..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb48.C +++ /dev/null @@ -1,10 +0,0 @@ -// Build don't link: -char *t1 (const char *s) -{ - return const_cast<char *>(s); -} - -char *&t1 (const char *&s) -{ - return const_cast<char *&>(s); -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb49.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb49.C deleted file mode 100644 index 95c454eaef1..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb49.C +++ /dev/null @@ -1,49 +0,0 @@ -// Build don't link: -// excess errors test - -// Here we declare ::S -typedef struct s1 *S; - -struct s1 -{ - int s; -}; - -struct A -{ - // Here we declare A::S - typedef struct s1 *S; -}; - -template<class T, class U> class XX; - -template<class T, class U> -class X -{ -public: - static T *do_something (); - friend class T; // ERROR - `T' is a template parameter - friend class XX<T, U>; -}; - -struct N -{ - // Here we declare N::S - class S - { - }; - - // Should use N::S and A::S. - typedef X<S, A::S> X_S; - - void bug (); -}; - -void -N::bug () -{ - // X_S is template class X<N::S, A::S> - // `s' is N::S. - S *s = X_S::do_something (); -} - diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb5.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb5.C deleted file mode 100644 index 6609be8c0dd..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb5.C +++ /dev/null @@ -1,13 +0,0 @@ -// Build don't link: -enum { a, b }; - -class Bug { - int pri:8; - int flags:24; -public: - void bug() { - flags |= a; // this does not work - } -}; - -void dummy(Bug x) { x.bug(); } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb50.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb50.C deleted file mode 100644 index c7f90766af2..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb50.C +++ /dev/null @@ -1,16 +0,0 @@ -struct foo { }; -int f(int a, int b) -{ - if (b == 0) - throw foo(); - return a / b; -} -int main() -{ - try { - f(0, 0); - return 1; - } catch (foo x) { - return 0; - } -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb51.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb51.C deleted file mode 100644 index 0357f92ba66..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb51.C +++ /dev/null @@ -1,36 +0,0 @@ -// Build don't link: -typedef unsigned long Xv_opaque; - -class DynaString -{ -public: - DynaString(); - DynaString( const DynaString& dynaStr ); - DynaString( const long n ); - ~DynaString(); - - int operator ==( const char* const string ) const; -}; - -class DDE_Defaults -{ -public: - DynaString GetHost(); - DynaString GetService(); - DynaString GetDatabase(); -}; - -extern DDE_Defaults* ddeDefaults; - -void -f() -{ - DynaString tempHost, tempService, tempDatabase; - if( (tempHost = ddeDefaults->GetHost()) == 0 - || (tempService = ddeDefaults->GetService()) == 0 - || (tempDatabase = ddeDefaults->GetDatabase()) == 0 - ) - { - } -} - diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb52.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb52.C deleted file mode 100644 index 50b45169ab8..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb52.C +++ /dev/null @@ -1,37 +0,0 @@ -// Build don't link: -class base { -protected: - virtual void f(); -}; - -class d1 : public virtual base { -protected: - void f(); -}; - -void d1::f() -{ - base::f(); -} - -class dd1 : public virtual d1 { -protected: - void f(); -}; - -void dd1::f() -{ - d1::f(); - base::f(); -} - -class d1_and_base : public virtual d1, public virtual base { -protected: - void f(); -}; - -void d1_and_base::f() -{ - d1::f(); - base::f(); -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb54.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb54.C deleted file mode 100644 index dfcf3a9e927..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb54.C +++ /dev/null @@ -1,7 +0,0 @@ -#include <iomanip.h> - -int main() -{ - cout << setbase(3) << endl; - exit (0); -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb55.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb55.C deleted file mode 100644 index 4ba4b54eff0..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb55.C +++ /dev/null @@ -1,12 +0,0 @@ -// Build don't link: -// Since the constructor is in streambuf.h, additional diagnostics are -// produced, which are not really supported in the old-deja framework -// excess errors test - XFAIL *-*-* -#include <strstream.h> - -void -t( char* buf ) -{ - istrstream str = buf; //ERROR - inaccessible copy constructor -} - diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb56.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb56.C deleted file mode 100644 index 2d497f8b4e3..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb56.C +++ /dev/null @@ -1,9 +0,0 @@ -// Error: Internal compiler error on 1998/05/28 snapshot. -// Build don't link: - -class foo { - typedef int sometype; -}; - -struct die : public foo::sometype { // ERROR - invalid base type -}; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb57.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb57.C deleted file mode 100644 index 5f7de55559d..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb57.C +++ /dev/null @@ -1,7 +0,0 @@ -// Build don't link: -#include <exception> -//using namespace std; -class A { - class B : public std::exception {} - ; -}; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb58.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb58.C deleted file mode 100644 index 3612034bf70..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb58.C +++ /dev/null @@ -1,14 +0,0 @@ -// Special g++ Options: -// Test for g++ array init extension - -class A { -public: - A(int i) {} -private: - A( const A & ) {} -}; - -main() -{ - A *list = new A[10](4); -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb59.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb59.C deleted file mode 100644 index 7c0c1534ae4..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb59.C +++ /dev/null @@ -1,28 +0,0 @@ -#define INC_FUNCTIONAL 1 -#define USE_STATIC_CAST 1 - -#include <vector> -#include <numeric> -#ifdef INC_FUNCTIONAL -#include <functional> -#endif - -template<class R> int p( int val, R& r ) -{ - return val + r; -} - -template<class R> void f( vector<R>& v ) -{ -#ifdef USE_STATIC_CAST - accumulate( v.begin(), v.end(), 0, static_cast<int (*)(int, R&)>(p) ); -#else - accumulate( v.begin(), v.end(), 0, p<R> ); -#endif -} - -int main() -{ - vector<int> r; - f( r ); -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb6.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb6.C deleted file mode 100644 index 157bf472f1a..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb6.C +++ /dev/null @@ -1,14 +0,0 @@ -// Build don't link: -class A { -public: - A() { t=0; } - double t; -}; -template <class T> -class B { -public: - void f1() { new T; f2(); } - void f2() { new T; } -}; -template class B<A>; - diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb60.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb60.C deleted file mode 100644 index 64ca71d9606..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb60.C +++ /dev/null @@ -1,18 +0,0 @@ -//Build don't link: -#include <string> - -class t { -public: - t(const string& s) : s_(s) {} - string s_; - static t* t_; -}; - -t* t::t_; - -t* makeT() -{ - return new t("test"); - return t::t_ ? t::t_ : - t::t_ = new t("test"); -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb61.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb61.C deleted file mode 100644 index 370273ae26d..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb61.C +++ /dev/null @@ -1,8 +0,0 @@ -// Build don't link: -void -action0(float& arg1) -{ - long cn0 = 1; - - arg1 = cn0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb62.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb62.C deleted file mode 100644 index 02646b2fb8a..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb62.C +++ /dev/null @@ -1,7 +0,0 @@ -//Build don't link: -#include <vector> - -void f(void) -{ - vector<int> l(5, 0); -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb63.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb63.C deleted file mode 100644 index 0e8559124d6..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb63.C +++ /dev/null @@ -1,15 +0,0 @@ -//Special g++ Options: -//This uses GNU extensions, so disable -ansi -#include <stdio.h> - -class A { -public: - A(bool b) { abort(); } - A(int a, bool b) { printf("cool\n"); } -}; - -main() { - A* a; - a = new A[2] = { A(1,false), A(1,false) } ; - a = new A[2](1,false); -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb64.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb64.C deleted file mode 100644 index da043af5191..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb64.C +++ /dev/null @@ -1,25 +0,0 @@ -// Build don't link: -template <class A> -class B:public A { - B(){} -}; - -template <class A> -class C:public B<A> { - C(){} -}; - -/* -g++ bugsol.C -bugsol.C:9: Internal compiler error. -bugsol.C:9: Please submit a full bug report to `egcs-bugs@cygnus.com'. - -g++ -v -Reading specs from -/home/pierre/local/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.16/specs -gcc version egcs-2.90.16 971105 (gcc2-970802 experimental) - -egcc compiled with gcc version 2.7.2.1 on debian 1.3.1 - -*/ - diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb65.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb65.C deleted file mode 100644 index 94be7ecbdb7..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb65.C +++ /dev/null @@ -1,22 +0,0 @@ -#include <iterator> - -template<size_t n, size_t i> struct PartialDotProduct { - template<class T> - static T Expand(T* a, T* b) { return T(); } -}; - -const int N = 10; - -template<class In1, class In2> -typename iterator_traits<In1>::value_type -dot(In1 f1, In2 f2) -{ - return PartialDotProduct<N, 0>::Expand(f1, f2); // line 14 -} - -int main() -{ - double a[N], b[N]; - - double s = dot(&a[0], &b[0]); -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb66.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb66.C deleted file mode 100644 index d79865f21d9..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb66.C +++ /dev/null @@ -1,22 +0,0 @@ -#include <assert.h> -#include <iostream.h> - -int bar () -{ - throw 100; -} - -int main () -{ - int i = 0; - try - { - i = bar (); - } - catch (...) - { - } - -// cout << "i = " << i << endl; - assert (i == 0) ; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb67.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb67.C deleted file mode 100644 index 45cdedd995c..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb67.C +++ /dev/null @@ -1,6 +0,0 @@ -// Build don't link: -/* -Check whether a typedef for a basic type as a baseclass is diagnosed. -*/ -typedef int an_int; -class bar : public an_int {}; // ERROR - not an aggregate diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb69.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb69.C deleted file mode 100644 index 9cc5f4a3ffe..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb69.C +++ /dev/null @@ -1,9 +0,0 @@ - #include <iostream.h> - struct foo { - foo(int x) { cerr << "foo's int constructor (" << x << ")\n"; }; - }; - struct bar : foo { - typedef int an_int; - bar() : bar::an_int(3) {}; // will call foo::foo(3) - }; -int main() { bar b; } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb7.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb7.C deleted file mode 100644 index fc43aab4179..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb7.C +++ /dev/null @@ -1,16 +0,0 @@ -// Build don't link: -#include <vector> - -class T -{ - public: - T(); - -}; - -vector <T> tp; - -void f() -{ - tp.insert(tp.begin(), 10 , T()); -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb70.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb70.C deleted file mode 100644 index 30da1845973..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb70.C +++ /dev/null @@ -1,17 +0,0 @@ -// conversion ops should be treated as coming from the most derived class -// for overload resolution. See [over.match.funcs]. -// Build don't link: - -class X { -public: - operator bool() const; -}; - -class Y : public X { -private: - operator void*() const; -}; - -int f(Y const& y) { - return bool(y); -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb71.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb71.C deleted file mode 100644 index 1417c4ab891..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb71.C +++ /dev/null @@ -1,37 +0,0 @@ -// Build don't link: -typedef __SIZE_TYPE__ size_t; - -class A { - -public: - void operator delete(void*, size_t); - void* operator new(size_t); -}; - -class B : public A { -friend class D; - - B(); - unsigned counter; -}; - -class D { - - int ins( B*&); -}; //WARNING - only private members - -int -D::ins( B*& tempN) -{ - unsigned i; - - if (i == 10) { - } - else { - } - - tempN = new B(); - tempN->counter = 20; - - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb73.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb73.C deleted file mode 100644 index b5aae397a8a..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb73.C +++ /dev/null @@ -1,14 +0,0 @@ -// Special g++ Options: -O -Wall -// Depeletes VM. - -#include <iostream.h> -#include <list> -#include <algorithm> -using namespace std; - -int main() -{ - int daten [16] = { 1, 4, 4, 6, 1, 2, 2, 3, 6, 6, 6, 5, 7, 5, 4, 4}; - list<int> menge; - copy (daten, daten+16, back_inserter(menge)); -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb74.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb74.C deleted file mode 100644 index 1ec7da6cc71..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb74.C +++ /dev/null @@ -1,33 +0,0 @@ -// Build don't link: -class base { -public: - virtual ~base(); -}; - - -class foo : public base { - -public : - - foo (char *cs); - - virtual void op (unsigned char dummy = false); - unsigned char m_dummy; -}; - - -void foo :: op ( unsigned char dummy) - -{ - bool bar; - - if (dummy) { - foo IT_tempPhase( 0 ); - return; - } - - if ((m_dummy || bar)) { - - } - -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb75.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb75.C deleted file mode 100644 index 41ad816bddd..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb75.C +++ /dev/null @@ -1,19 +0,0 @@ -// Build don't link: -int*& foo (int const *& x) -{ - return const_cast<int*&> (x); -} - -/* -If the references in this example are changed to pointers (change -all `&''s to `*'), no warnings result. - -I think this is incorrect according to CD2 5.2.11, para 4: - -4 An lvalue of type T1 can be explicitly converted to an lvalue of type - T2 using the cast const_cast<T2&> (where T1 and T2 are object types) - if a pointer to T1 can be explicitly converted to the type pointer to - T2 using a const_cast. The result of a reference const_cast refers to - the original object. - -*/ diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb76.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb76.C deleted file mode 100644 index e2817eefd09..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb76.C +++ /dev/null @@ -1,19 +0,0 @@ -//Build don't link: -// the template operator!= interferes. It should be in a namespace. -// excess errors test - XFAIL *-*-* - -#include <utility> - -enum T { - V1 -}; - -struct X { - T t : 31; -}; - -void -f(X& v) { - if( v.t != V1 ) { // complains about taking address of bitfield - } -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb77.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb77.C deleted file mode 100644 index 206b27dbf22..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb77.C +++ /dev/null @@ -1,30 +0,0 @@ -#include <stream.h> -#include <strstream.h> - -int -main(int, char* []) -{ - strstream s; - - s << "line 1\nline 2\n\nline 4"; - s << ends; - - int nLine = 0; - - while( true ) { - char* line = 0; - s.gets(&line); - - if( ! line ) { - break; - } - - ++nLine; - cout << nLine << ": " << line << endl; - - if( nLine > 10 ) { // stop infinite loop - break; - } - } - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb79.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb79.C deleted file mode 100644 index 5691532b99f..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb79.C +++ /dev/null @@ -1,23 +0,0 @@ -// Makes bogus x86 assembly code. -#include <iostream.h> - -template<class T> -T max(T a, T b) -{ - return (a > b) ? a : b; -} - -// Prototypes (enable one or the other) -double max<>(double, double); // ERROR - bogus code -// int max(int, int); - -int main() -{ - int i = 123; - double d = 1234.5678; - - cout.precision(12); - cout << max(d, i) << endl; // #1 - cout << max(i, d) << endl; // #2 - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb8.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb8.C deleted file mode 100644 index 213bb6de90b..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb8.C +++ /dev/null @@ -1,13 +0,0 @@ - -class foo { -public: - operator <<(const void *); //ERROR - no return type - operator <<(char *); //ERROR - no return type -}; - -void main() -{ //ERROR - wrong return type for main - foo f; - f << (void*)0; -} - diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb80.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb80.C deleted file mode 100644 index 71614236558..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb80.C +++ /dev/null @@ -1,7 +0,0 @@ -// Build don't link: -#include <exception> - -class A { - class B : public std::exception {} - ; -}; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb81.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb81.C deleted file mode 100644 index 919fd58b0fe..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb81.C +++ /dev/null @@ -1,42 +0,0 @@ -// Build don't link: -class x -{ -public: - x (int init_buffer_size=0); - ~x (); -}; - - - -class xSequence -{ -public: - xSequence (); - ~xSequence (); - x Get(int index)const; -}; - - - -class foo -{ -public: - bool bar(const x & name, x & value); - -}; - - - -bool foo::bar(const x & name, x & value) -{ - bool result = false; - - xSequence seq; - x v1, v2; - if(result ? bar(seq.Get(1),v2) : bar(seq.Get(2),v2)) - - ; - - return result; -} - diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb82.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb82.C deleted file mode 100644 index 1e4d8c6249c..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb82.C +++ /dev/null @@ -1,12 +0,0 @@ -#include <stdio.h> - -template <int n1> -double val <int> () -{ // ERROR - bogus code - return (double) n1; -}; - -int main () -{ - printf ("%d\n", val<(int)3> ()); -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb83.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb83.C deleted file mode 100644 index 7121e140078..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb83.C +++ /dev/null @@ -1,16 +0,0 @@ -// Skip if not native -// Special g++ Options: -fprofile-arcs -ftest-coverage -void -swap(int& x, int& y) throw() -{ - int tmp = x; - x = y; - y = tmp; -} - -main() -{ - int i = 5; - int j = 7; - swap(i, j); -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb84.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb84.C deleted file mode 100644 index dce51d86d52..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb84.C +++ /dev/null @@ -1,17 +0,0 @@ -// Error: Internal Compiler error on GCC 2.7.2.3 & EGCS 1998/05/23 snapshot. - -class A { -public: - enum { ONE, TWO, THREE }; -}; - -template <const unsigned c1,const unsigned c2,const unsigned c3> -void f() { - -} - -int -main() -{ - f<A::ONE,A::TWO,A::THREE>(); -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb86.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb86.C deleted file mode 100644 index 463d2d1cb60..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb86.C +++ /dev/null @@ -1,5 +0,0 @@ -// Build don't link: -template <class T> -class Q { - friend void foo<T> (); -}; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb87.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb87.C deleted file mode 100644 index eee6ff67a75..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb87.C +++ /dev/null @@ -1,6 +0,0 @@ -template <unsigned X, class T> struct Foo { - friend void operator<<(int, Foo const &) {} -}; -template <unsigned X> class Bar : public Foo<X,int> {}; -inline Bar<0> bar(int,int,int) { return Bar<3>(); } // ERROR - no conversion - diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb88.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb88.C deleted file mode 100644 index 006fe568e51..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb88.C +++ /dev/null @@ -1,15 +0,0 @@ -// Another magic NULL problem. -// Special g++ Options: -w - -#include <stddef.h> - -int main() -{ - try - { - throw(NULL); - } - catch (...) - { - } -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb9.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb9.C deleted file mode 100644 index cec700220cb..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb9.C +++ /dev/null @@ -1,21 +0,0 @@ -// Build don't link: -template <class Key> -class d0om_Hashmap -{ -public: - typedef int value_type; - - class iterator - { - public: - value_type* operator-> () const; - }; - -}; - - -template <class Key> -d0om_Hashmap<Key>::value_type* d0om_Hashmap<Key>::iterator::operator-> () const -{ - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb90.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb90.C deleted file mode 100644 index 2a43645d017..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb90.C +++ /dev/null @@ -1,22 +0,0 @@ -// Special g++ Options: -O2 -// Build don't link: - -#ifdef HIDE_BUG -#define realloc Realloc -#endif - -class TmpRgn { -public: - void - realloc(); -}; - -class TmpActor { - TmpRgn tmpRgn; - -public: - void - realloc() { - tmpRgn.realloc(); - } -}; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb91.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb91.C deleted file mode 100644 index 8262b7939e1..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb91.C +++ /dev/null @@ -1,85 +0,0 @@ -#include <sys/types.h> -#include <algorithm> -typedef short _eb91_int16_t; -typedef char _eb91_int8_t; -typedef unsigned char _eb91_u_int8_t; -typedef unsigned short _eb91_u_int16_t; - -template <class INT> -class other_endian -{ -private: - - INT value; - - - _eb91_u_int16_t change_endian(_eb91_u_int16_t x) - { - union { - _eb91_u_int16_t i; - _eb91_u_int8_t c[2]; - } val; - val.i = x; - swap(val.c[0], val.c[1]); - return val.i; - }; - - _eb91_int16_t change_endian(_eb91_int16_t x) - { - union { - _eb91_int16_t i; - _eb91_int8_t c[2]; - } val; - val.i = x; - swap(val.c[0], val.c[1]); - return val.i; - }; -public: - other_endian(const INT i = 0) - { - value = change_endian(i); - } - - operator INT() - { - return change_endian(value); - } -}; - -template <class INT> -class same_endian -{ - INT value; - -public: - same_endian(const INT i = 0) - { - value = i; - } - - operator INT() - { - return value; - } -}; - - - - - - - - - - - - - - - - - -int main() { - other_endian <_eb91_u_int16_t> little_endian_16_bit_int; - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb92.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb92.C deleted file mode 100644 index 8cb1639323c..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb92.C +++ /dev/null @@ -1 +0,0 @@ -template<int N> f<0>(){} // ERROR - invalid code diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb93.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb93.C deleted file mode 100644 index 988e65d7321..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb93.C +++ /dev/null @@ -1,30 +0,0 @@ -// Error: Internal compiler error on egcs 1998/05/28 snapshot. - -const double M_PI=3.14159265358979323846; - -template<int N,int I,int J,int K> -inline double SineSeries() -{ - const double x=I*2*M_PI/N; - const bool go=K+1!=J; - return 1.0-x*x/(2*K+2)/(2*K+3)*SineSeries<N*go,I*go,J*go,(K+1)*go>(); -} - -template<> -inline double SineSeries<0,0,0,0>() -{ - return 1.0; -} - -template<int N,int I> -inline double Sine() -{ - const double x=(I*2*M_PI/N); - return x * SineSeries<N,I,10,0>(); -} - -int main() -{ - double f=Sine<32,5>() - return 0; // ERROR - parse error -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb94.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb94.C deleted file mode 100644 index 7f7c0b4e8eb..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb94.C +++ /dev/null @@ -1,15 +0,0 @@ - - -class baseClass -{ -private: -static int variable; -}; - -class myClass : public baseClass -{ -private: -static int variable; // this is intentionally duplicated -}; - -myClass::variable = 0; //ERROR - no type diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb95.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb95.C deleted file mode 100644 index 0d8e405c80a..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb95.C +++ /dev/null @@ -1,17 +0,0 @@ -struct A {}; - -template <class T> -void operator+ (A &i, T &b) {} - -template<class T> -void func (A &a, T &b) {} - -int main() -{ - A a; - -#if STRANGE - func(a, "egcs"); -#endif - a+"egcs"; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb97.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb97.C deleted file mode 100644 index e05cc415b66..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb97.C +++ /dev/null @@ -1,24 +0,0 @@ -// Creates bad assembly on sparc and x86 -template<unsigned long SIZE> -struct Array { }; - -template<unsigned long SIZE> -Array<SIZE> test_ok(const Array<SIZE>& a) { - Array<SIZE> result; - return(result); -} - -template<unsigned long SIZE> -Array<SIZE + 1> test_error(const Array<SIZE>& a) { - Array<SIZE + 1> result; - return(result); -} - -int main(int argc, char* argv[]) { - Array<2> a; - - test_ok(a); - test_error(a); // <<< MARKED LINE! - - return(0); -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb98.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb98.C deleted file mode 100644 index cc19f0997cd..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb98.C +++ /dev/null @@ -1,17 +0,0 @@ -// Error: Internal compiler error in egcs 1998/05/28 snapshot. - - - template<class T, unsigned int Length> - inline - unsigned int - extent(T (&x)[Length]) - { - return Length; - } - - extern int b[]; - - void f() - { - extent(b); // ERROR - no matching function - } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb99.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb99.C deleted file mode 100644 index 4cced8b0a09..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb99.C +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - - - - - - - - - - - - -class ref_counted -{ - -protected: - ref_counted( void ) : _count( 0 ) {} - -public: - - unsigned int add_ref( void ) { return ++_count; } - unsigned int release( void ) { return --_count; } - unsigned int count( void ) const { return _count; } - - -protected: - unsigned int _count; -}; - - - - - -template < class T > -class ref_ptr -{ - -public: - ref_ptr( T* ptr = 0 ) : _ptr( ptr ) - { - add_ref(); - } - - ref_ptr( const ref_ptr & rptr ) : _ptr( rptr.get() ) - { - add_ref(); - } - - ~ref_ptr( void ) { release(); } - - - T* get( void ) const { return _ptr; } - T* operator->( void ) const { return get(); } - T& operator*( void ) const { return *get(); } - - bool operator!( void ) const { return get() == 0; } - bool operator==( const ref_ptr & rptr ) const { return *get() == *rptr; -} - bool operator<( const ref_ptr & rptr ) const { return *get() < *rptr; } - - - bool operator==( T* ptr ) const { return *get() == *ptr; } - bool operator<( T* ptr ) const { return *get() < *ptr; } - - const ref_ptr & operator=( const ref_ptr & rptr ) - { - release(); - _ptr = rptr.get(); - add_ref(); - - return *this; - } - - T* operator=( T* ptr ) - { - release(); - _ptr = ptr; - add_ref(); - - return _ptr; - } - -protected: - void add_ref( void ) - { - if( _ptr ) - _ptr->add_ref(); - } - - void release( void ) - { - if( _ptr && 0 == _ptr->release() ) - { - delete _ptr; - _ptr = 0; - } - } - - -protected: - T * _ptr; -}; - - -template< class T > -bool operator==( T* ptr, const ref_ptr< T > & rptr ) -{ - return *ptr == *rptr; -} - -template< class T > -bool operator<( T* ptr, const ref_ptr< T > & rptr ) -{ - return *ptr < *rptr; -} - - - -class Baz : public ref_counted { - int dummy; -}; - - -class Bar; - -int main() { - ref_ptr<Baz> foo; - static_cast<Bar *> (foo)->DoSomething; //ERROR - invalid cast -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/ebnull-cast.C b/gcc/testsuite/g++.old-deja/g++.robertl/ebnull-cast.C deleted file mode 100644 index d220e9089cf..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/ebnull-cast.C +++ /dev/null @@ -1,18 +0,0 @@ -class null { - null (null const&); - void operator& (); - - public: - null () {} - - template <typename T> - operator T* () const { return 0; } -} const null; - - -int main () -{ - int *p = static_cast<int*>(null); - - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/ebnull-oldcast.C b/gcc/testsuite/g++.old-deja/g++.robertl/ebnull-oldcast.C deleted file mode 100644 index cf6c21b6012..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/ebnull-oldcast.C +++ /dev/null @@ -1,17 +0,0 @@ -class null { - null (null const&); - void operator& (); - - public: - null () {} - - template <typename T> - operator T* () const { return 0; } -} const null; - -int main () -{ - int *p = (int*) null; - - return 0; -} diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/ebnull.C b/gcc/testsuite/g++.old-deja/g++.robertl/ebnull.C deleted file mode 100644 index e6eea2d6a54..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/ebnull.C +++ /dev/null @@ -1,17 +0,0 @@ -class null { - null (null const&); - void operator& (); - - public: - null () {} - - template <typename T> - operator T* () const { return 0; } -} const null; - -int main () -{ - int *p = null; - - return 0; -} |