aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/cast7.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/cast7.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/cast7.C12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/cast7.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/cast7.C
new file mode 100644
index 000000000..4f433f424
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/cast7.C
@@ -0,0 +1,12 @@
+// { dg-do run }
+// Test that we can add cv-quals in a static cast to a pointer-to-base type.
+
+struct A { int i; };
+struct B : public A {};
+
+int main()
+{
+ int B::* bp = &B::i;
+ const int A::* ap = static_cast<const int A::*>(bp);
+ return ap != bp;
+}