* g++.old-deja/g++.other/deref1.C: New test.
authorNathan Sidwell <nathan@acm.org>
Fri, 3 Sep 1999 08:59:06 +0000 (08:59 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Fri, 3 Sep 1999 08:59:06 +0000 (08:59 +0000)
From-SVN: r29080

gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.other/deref1.C [new file with mode: 0644]

index 2bf872d..ef6ee55 100644 (file)
@@ -1,3 +1,7 @@
+Fri Sep 03 09:31:10 BST 1999  Nathan Sidwell  <nathan@acm.org>
+
+       * g++.old-deja/g++.other/deref1.C: New test.
+
 Thu Sep 02 09:27:34 BST 1999  Nathan Sidwell  <nathan@acm.org>
 
        * g++.old-deja/g++.other/ambig2.C: New test.
diff --git a/gcc/testsuite/g++.old-deja/g++.other/deref1.C b/gcc/testsuite/g++.old-deja/g++.other/deref1.C
new file mode 100644 (file)
index 0000000..706cd92
--- /dev/null
@@ -0,0 +1,13 @@
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 1 Sep 1999 <nathan@acm.org>
+
+// [expr.unary.op]/1 says you can dereference all pointers except for pointers
+// to cv void.
+
+void fn (void *vp, volatile void *vvp)
+{
+  *vp;      // ERROR - not a pointer to object
+  *vvp;     // ERROR - not a pointer to object
+  &*vp;     // ERROR - not a pointer to object
+  &*vvp;    // ERROR - not a pointer to object
+}