summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/tree-ssa/pr81408.C
blob: f94544b9e2d106541b553b1658f7bdea294e0525 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/* { dg-do compile } */
/* { dg-options "-O2 -std=gnu++11 -fopt-info-loop-missed -Wunsafe-loop-optimizations" } */

namespace a {
void b () __attribute__ ((__noreturn__));
template <typename> struct d;
template <typename e> struct d<e *>
{
  typedef e f;
};
struct g
{
  template <typename h> using i = h *;
};
}
using a::d;
template <typename j, typename> class k
{
  j l;

public:
  typename d<j>::f operator* () {}
  void operator++ () { ++l; }
  j
  aa ()
  {
    return l;
  }
};
template <typename m, typename n, typename ab>
bool
operator!= (k<m, ab> o, k<n, ab> p2)
{
  return o.aa () != p2.aa ();
}
struct p;
namespace a {
struct F
{
  struct q
  {
    using ai = g::i<p>;
  };
  using r = q::ai;
};
class H
{
public:
  k<F::r, int> begin ();
  k<F::r, int> end ();
};
int s;
class I
{
public:
  void
  aq (char)
  {
    if (s)
      b ();
  }
};
class u : public I
{
public:
  void
  operator<< (u o (u))
  {
    o (*this);
  }
  u operator<< (void *);
};
template <typename at, typename au>
at
av (au o)
{
  o.aq ('\n');
}
u ax;
}
struct p
{
  char *ay;
};
a::H t;
void
ShowHelpListCommands ()
{
  for (auto c : t) /* { dg-message "note: missed loop optimization: niters analysis .*" } */
    a::ax << c.ay << a::av;
}