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: Test(char c)11 Test(char c) : ch(c) {} Print()12 void Print() { printf("%c", ch); } 13 }; 14 main()15int main() 16 { 17 Test *p = new Test('x'); 18 19 p.Print(); // { dg-error "" } 20 } 21