summaryrefslogtreecommitdiff
path: root/gcc_arm/testsuite/g++.old-deja/g++.pt/local1.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc_arm/testsuite/g++.old-deja/g++.pt/local1.C')
-rwxr-xr-xgcc_arm/testsuite/g++.old-deja/g++.pt/local1.C21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc_arm/testsuite/g++.old-deja/g++.pt/local1.C b/gcc_arm/testsuite/g++.old-deja/g++.pt/local1.C
new file mode 100755
index 0000000..1b9e515
--- /dev/null
+++ b/gcc_arm/testsuite/g++.old-deja/g++.pt/local1.C
@@ -0,0 +1,21 @@
+template <class STRUCT, class MEMBER> inline STRUCT *
+setback(MEMBER *bp, MEMBER STRUCT::*offset)
+{
+ if(!bp) return 0;
+ union { int i; MEMBER STRUCT::*of; } u;
+ u.of = offset;
+ return (STRUCT *) ((int) bp - u.i);
+}
+
+
+struct S
+{
+ int i;
+};
+
+int main()
+{
+ S s;
+
+ S* sp = setback (&s.i, &S::i);
+}