Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / torture / pr68852.C
blobc2c6a585d3c796cbbf86c48a035b6539347defef
1 /* { dg-do compile } */
3 struct A {
4     double x, y, z, w;
5     A() {}
6     A(double, double p2, double p3, double) : y(p2), z(p3) {}
7     void m_fn1();
8 };
10 struct B {
11     double x, y;
13 struct D : A {
14     D() {}
15     D(double p1, double p2, double p3, double p4) : A(p1, p2, p3, p4) {}
18 class C {
19 public:
20     float _11, _12, _13, _14;
21     float _21, _22, _23, _24;
22     float _31, _32, _33, _34;
23     float _41, _42, _43, _44;
24     D m_fn2(B p1) {
25         double z(p1.x + _43);
26         return *this * D(p1.x, p1.y, z, 1);
27     }
28     int ProjectRectBounds_next;
29     B __trans_tmp_3;
30     int m_fn3(int) {
31         B a, b;
32         D c[1];
33         b = __trans_tmp_3;
34         c[2] = m_fn2(b);
35         c[3] = m_fn2(a);
36         c[ProjectRectBounds_next].m_fn1();
37         return 0;
38     }
39     D operator*(D p1) {
40         D d;
41         d.x = p1.x * _11 + p1.y * _21 + p1.z * _31 + _41;
42         d.y = p1.x * _12 + p1.y * _22 + p1.z * _32 + _42;
43         d.z = p1.x * _13 + p1.y * _23 + p1.z * _33 + _43;
44         d.w = p1.x * _14 + p1.y * _24 + p1.z * _34 + _44;
45         return d;
46     }
49 void fn1() {
50     C e;
51     int f = e.m_fn3(f);