Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.jason/dot.C

raw
1 // { dg-do assemble }
2 // PRMS Id: 4143
3 // Bug: Pointer is silently dereferenced in method call.
4
5 extern "C" int printf (const char *, ...);
6
7 class Test
8 {
9 char ch;
10 public:
11 Test(char c) : ch(c) {}
12 void Print() { printf("%c", ch); }
13 };
14
15 int main()
16 {
17 Test *p = new Test('x');
18
19 p.Print(); // { dg-error "" }
20 }