1 // PR c++/61539
2 // { dg-do compile { target c++11 } }
3
4 template <typename _CharT> class A;
5 template <typename> class B;
6 template <class charT> class C;
7 template <> class C<char>
8 {
9 virtual void xparse (int &, const B<A<char> > &) const;
10 };
11 template <class T, class charT = char> class G : C<charT>
12 {
13 public:
G(void *)14 G (void *) {}
15 void default_value (const T &);
16 void xparse (int &, const B<A<charT> > &) const;
17 };
18 template <class T, class charT>
19 void validate (int &, const B<A<charT> > &, T *, int);
20 template <class T, class charT>
xparse(int & p1,const B<A<charT>> & p2)21 void G<T, charT>::xparse (int &p1, const B<A<charT> > &p2) const
22 {
23 validate (p1, p2, (T *)0, 0);
24 }
value(T *)25 template <class T> G<T> *value (T *) { return new G<T>(0); }
26 namespace Eigen
27 {
28 template <typename T> struct D;
29 template <typename, int, int, int = 0, int = 0, int = 0 > class F;
30 template <typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows,
31 int _MaxCols>
32 struct D<F<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
33 {
34 typedef _Scalar Scalar;
35 };
36 template <typename, int, int, int, int, int _MaxCols> class F
37 {
38 public:
39 typedef typename Eigen::D<F>::Scalar Scalar;
40 F (const Scalar &, const Scalar &, const Scalar &);
41 };
42 template <class... T>
43 void validate (int &, const B<A<char> > &, Eigen::F<T...> *);
44 }
45 int main (int, char *[])
46 {
47 Eigen::F<double, 3, 1> a (0, 0, 0);
48 value (&a)->default_value (Eigen::F<double, 3, 1>(0, 0, 0));
49 }
50