1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-ipa-icf-details" } */
4 template <int dim> class B;
5 template <int, int dim> class TriaObjectAccessor;
6 template <int, typename Accessor> class A;
7 template <int dim> class TriaDimensionInfo {
9 typedef A<3, TriaObjectAccessor<2, 3> > raw_quad_iterator;
10 typedef A<3, B<3> > raw_hex_iterator;
11 typedef raw_hex_iterator raw_cell_iterator;
13 template <int dim> class Triangulation : public TriaDimensionInfo<1> {
15 typedef typename TriaDimensionInfo<dim>::raw_quad_iterator raw_quad_iterator;
16 TriaDimensionInfo::raw_cell_iterator end() const;
17 raw_quad_iterator end_quad() const {
18 return raw_quad_iterator(const_cast<Triangulation *>(this), 0, 0);
21 template <int dim> class TriaAccessor {
23 typedef void AccessorData;
24 TriaAccessor(const Triangulation<dim> * = 0);
25 Triangulation<1> *tria;
29 template <int dim> class TriaObjectAccessor<2, dim> : public TriaAccessor<dim> {
31 typedef typename TriaAccessor<dim>::AccessorData AccessorData;
32 TriaObjectAccessor(const Triangulation<dim> * = 0);
34 template <int dim> class TriaObjectAccessor<3, dim> : public TriaAccessor<dim> {
36 typedef typename TriaAccessor<dim>::AccessorData AccessorData;
37 TriaObjectAccessor(const Triangulation<dim> * = 0);
39 template <int dim> class B : public TriaObjectAccessor<dim, dim> {
41 typedef typename TriaObjectAccessor<dim, dim>::AccessorData AccessorData;
42 B(const Triangulation<dim> * = 0);
44 template <int dim, typename Accessor> class A {
47 A(const Triangulation<dim> *, int, int);
50 template class Triangulation<3>;
51 template <int dim, typename Accessor>
52 A<dim, Accessor>::A(const Triangulation<dim> *, int, int) {}
54 TriaAccessor<dim>::TriaAccessor(const Triangulation<dim> *)
55 : tria(), a(-1), b(-2), c(-3) {}
57 TriaObjectAccessor<2, dim>::TriaObjectAccessor(const Triangulation<dim> *) {}
59 TriaObjectAccessor<3, dim>::TriaObjectAccessor(const Triangulation<dim> *) {}
60 template <int dim> B<dim>::B(const Triangulation<dim> *) {}
62 TriaDimensionInfo<3>::raw_cell_iterator Triangulation<3>::end() const {
63 return raw_hex_iterator(const_cast<Triangulation *>(this), 0, 0);
66 #pragma GCC optimize ("-O0")
70 Triangulation<3>::raw_quad_iterator i1 = t.end_quad();
71 TriaDimensionInfo<3>::raw_cell_iterator i2 = t.end();
73 if(i2.accessor.c != -3)
79 /* { dg-final { scan-ipa-dump "Equal symbols: 0" "icf" } } */