summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/expr/cast10.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/expr/cast10.C')
-rw-r--r--gcc/testsuite/g++.dg/expr/cast10.C10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/expr/cast10.C b/gcc/testsuite/g++.dg/expr/cast10.C
new file mode 100644
index 000000000..cd3e0fc3c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/cast10.C
@@ -0,0 +1,10 @@
+// { dg-do compile }
+// This used to error out because we would try to convert m to a short.
+
+
+struct a {};
+void b() {
+ int a::*m;
+ a *c;
+ short p = reinterpret_cast<char*>(&(c->*m)) - reinterpret_cast<char*>(c);
+}