summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/torture/pr49628.C
blob: 4bc6543a35e324b1ee7ca33e3a5d39e8755e136c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* { dg-do compile } */

#include <vector>

template <int rank, int dim> class Tensor;
template <int dim> class Tensor<1,dim> {
public:
    explicit Tensor (const bool initialize = true);
    Tensor (const Tensor<1,dim> &);
    Tensor<1,dim> & operator = (const Tensor<1,dim> &);
    double values[(dim!=0) ? (dim) : 1];
};
template <int dim>
inline Tensor<1,dim> & Tensor<1,dim>::operator = (const Tensor<1,dim> &p)
{
  for (unsigned int i=0; i<dim; ++i)
    values[i] = p.values[i];
};
template <int dim> class Quadrature {
public:
    const unsigned int n_quadrature_points;
};
class MappingQ1
{
  class InternalData  {
  public:
      std::vector<Tensor<1,3> > shape_derivatives;
      unsigned int n_shape_functions;
  };
  void compute_data (const Quadrature<3> &quadrature, InternalData &data)
      const;
};
void MappingQ1::compute_data (const Quadrature<3> &q, InternalData &data) const
{
  const unsigned int n_q_points = q.n_quadrature_points;
  data.shape_derivatives.resize(data.n_shape_functions * n_q_points);
}