Fix test-suite fallout of default -Wreturn-type.
[official-gcc.git] / gcc / testsuite / g++.dg / ipa / pr45572-1.C
blob03a299ff422a2afe785e8e71e82babfb9120f3ee
1 // { dg-do compile }
2 // { dg-options "-finline-small-functions -findirect-inlining -finline-functions -O" }
4 extern "C" {
5 typedef long unsigned int size_t;
6 typedef long int __ssize_t;
7 typedef struct _IO_FILE FILE;
8 typedef struct
10 } __mbstate_t;
11 extern __inline __attribute__ ((__gnu_inline__)) int
12 fgetc_unlocked (FILE *__fp)
14   return 0;
16 extern __inline __attribute__ ((__gnu_inline__)) int
17 putc_unlocked (int __c, FILE *__stream)
19   return 0;
21 extern __inline __attribute__ ((__gnu_inline__)) __ssize_t
22 getline (char **__lineptr, size_t *__n, FILE *__stream)
24   return 0;
26 extern __inline __attribute__ ((__gnu_inline__)) int
27 ferror_unlocked (FILE *__stream) throw ()
29   return 0;
32 typedef struct
33 {} __mpf_struct;
34 typedef __mpf_struct mpf_t[1];
35 typedef const __mpf_struct *mpf_srcptr;
36 typedef __mpf_struct *mpf_ptr;
37 extern "C" {
38  void __gmpf_add (mpf_ptr, mpf_srcptr, mpf_srcptr);
40 class _knumber
42  public:
43   enum NumType {SpecialType, IntegerType, FractionType, FloatType};
44   virtual NumType type(void) const = 0;
45   virtual _knumber * add(_knumber const & arg2) const = 0;
46   virtual operator long int(void) const = 0;
48 class _knumfloat : public _knumber
50   _knumfloat(double num = 1.0)
51   ;
52   virtual NumType type(void) const ;
53   virtual _knumber * add(_knumber const & arg2) const;
54   virtual operator long int (void) const;
55     mpf_t _mpf;
57 _knumber *_knumfloat::add(_knumber const & arg2) const
59   if (arg2.type() == SpecialType)
60     return arg2.add(*this);
62     _knumfloat tmp_num(arg2);
63     return tmp_num.add(*this);
64   }
65   _knumfloat * tmp_num = new _knumfloat();
66   __gmpf_add(tmp_num->_mpf, _mpf,
67    dynamic_cast<_knumfloat const &>(arg2)._mpf);