[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / g++.dg / lto / pr65193_0.C
blobceebe51069d8b3323b6672eaf076dfb10467b7c4
1 /* { dg-lto-do link } */
2 /* { dg-require-effective-target fpic } */
3 /* { dg-lto-options {{-fPIC -r -nostdlib -flto -O2 -g -Wno-return-type}} } */
5 void frexp (int, int *);
6 namespace std
8   int ldexp (int, int);
9   struct A
10     {
11     };
12   template <class T> T get_min_shift_value ();
13   template <class> struct min_shift_initializer
14     {
15       struct B
16         {
17           B () { get_min_shift_value<long double> (); }
18         } static const b;
19       static void
20           m_fn1 ()
21             {
22               b;
23             }
24     };
25   template <class T>
26       const typename min_shift_initializer<T>::B min_shift_initializer<T>::b;
27   template <class T>
28       inline T
29       get_min_shift_value ()
30         {
31           using std::ldexp;
32           static T c = ldexp (0, 0);
33           min_shift_initializer<T>::m_fn1;
34         }
35   template <class T, class Policy>
36       void
37       float_next_imp (T p1, Policy p2)
38         {
39           using std::ldexp;
40           int d;
41           float_next (0, p2);
42           frexp (p1, &d);
43         }
44   template <class T, class Policy>
45       int
46       float_next (const T &p1, Policy &p2)
47         {
48           float_next_imp (p1, p2);
49         }
50   template <class T, class Policy> void float_prior_imp (T, Policy)
51     {
52       get_min_shift_value<T> ();
53     }
54   template <class T, class Policy> int float_prior (T, Policy)
55     {
56       float_prior_imp (static_cast<T> (0), 0);
57     }
58   template <class T, class U, class Policy>
59       void
60       nextafter (T p1, U p2, Policy p3)
61         {
62           p2 ? float_next (0, p3) : float_prior (p1, 0);
63         }
64   long double e;
65   int f;
66   void
67       nextafter ()
68         {
69           nextafter (e, f, A ());
70         }