summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/dot.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/dot.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/dot.C20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/dot.C b/gcc/testsuite/g++.old-deja/g++.jason/dot.C
new file mode 100644
index 000000000..41b8d814f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.jason/dot.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// PRMS Id: 4143
+// Bug: Pointer is silently dereferenced in method call.
+
+extern "C" int printf (const char *, ...);
+
+class Test
+{
+ char ch;
+ public:
+ Test(char c) : ch(c) {}
+ void Print() { printf("%c", ch); }
+};
+
+int main()
+{
+ Test *p = new Test('x');
+
+ p.Print(); // { dg-error "" }
+}