Clean up some minor white space issues in trans-decl.c and trans-expr.c
[official-gcc.git] / gcc / testsuite / g++.dg / torture / pr56694.C
blobd3de05101695d7ba57e00c1988fc494b2a33da8b
1 // { dg-do compile }
2 // { dg-options "-fopenmp" }
3 // { dg-require-effective-target fopenmp }
5 class GException {
6 public:
7     class vector_mismatch {
8     public:
9         vector_mismatch(int size1, int size2);
10     };
12 class GVector{
13 public:
14     GVector& operator+=(const GVector& v);
15     int m_num;
16     double* m_data;
18 inline GVector& GVector::operator+= (const GVector& v)
20   if (m_num != v.m_num)
21     throw GException::vector_mismatch(m_num, v.m_num);
22   for (int i = 0; i < m_num; ++i)  m_data[i] += v.m_data[i];
24 void eval(GVector* m_gradient, GVector* vect_cpy_grad, int n)
26 #pragma omp sections
27     {
28       for (int i = 0; i < n; ++i)
29         *m_gradient += vect_cpy_grad[i];
30     }