]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/g++.dg/ipa/pr82352.C
Remove an invalid defintion [PR101568].
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / ipa / pr82352.C
CommitLineData
fcb6fced
ML
1// PR ipa/82352
2// { dg-do compile }
3// { dg-options "-O2" }
4
85e0b2c4 5typedef __SIZE_TYPE__ size_t;
fcb6fced
ML
6
7class A
8{
9public :
10 typedef enum { Zero = 0, One = 1 } tA;
11 A(tA a) { m_a = a; }
12
13private :
14 tA m_a;
15};
16
17class B
18{
19public :
50f3ac1b 20 void *operator new(size_t);
fcb6fced
ML
21};
22
23class C
24{
25public:
26 virtual void ffff () = 0;
27};
28
29class D
30{
31 public :
32 virtual void g() = 0;
33 virtual void h() = 0;
34};
35
36template<class T> class IIII: public T, public D
37{
38public:
39 void ffff()
40 {
41 if (!m_i2) throw A(A::One);
42 };
43
44 void h()
45 {
46 if (m_i2) throw A(A::Zero);
47 }
48
49protected:
50 virtual void g()
51 {
52 if (m_i1 !=0) throw A(A::Zero);
53 };
54
55private :
56 int m_i1;
57 void *m_i2;
58};
59
60class E
61{
62private:
63 size_t m_e;
64 static const size_t Max;
65
66public:
67 E& i(size_t a, size_t b, size_t c)
68 {
69 if ((a > Max) || (c > Max)) throw A(A::Zero );
70 if (a + b > m_e) throw A(A::One );
71 return (*this);
72 }
73
74 inline E& j(const E &s)
75 {
76 return i(0,0,s.m_e);
77 }
78};
79
80class F : public C { };
81class G : public C { };
82class HHHH : public B, public F, public G { };
83
84void k()
85{
86 new IIII<HHHH>();
87}
88
89void l()
90{
91 E e1, e2;
92 e1.j(e2);
93}