summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/tree-ssa/pr21584-1.C
blob: 2c96d1027d76c32ca4e188f0b3b519fa280acce2 (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
extern "C" {

extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
     throw () __attribute__ ((__nonnull__ (1, 2)));

extern char *foo (char *__restrict __s) throw ();
}

class cset {
public:
  cset();
  int operator()(unsigned char) const;
private:
  char v[(127 * 2 + 1)+1];
};

inline int cset::operator()(unsigned char c) const
{
  return v[c];
}

extern cset csspace;

void baz()
{
  char *vec;
  char buf[512];

  char *p = buf;
  while (csspace(*p))
    p++;

  if (*p != '#' && (p = foo(buf)) != 0) {
    vec = new char[10+ 1];
    strcpy(vec, p);
  }
}