diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/cast7.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/cast7.C | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cast7.C b/gcc/testsuite/g++.old-deja/g++.other/cast7.C new file mode 100644 index 000000000..4f433f424 --- /dev/null +++ b/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; +} |