aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/tt2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.pt/tt2.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/tt2.C22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/tt2.C b/gcc/testsuite/g++.old-deja/g++.pt/tt2.C
new file mode 100644
index 00000000000..c4323a50340
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/tt2.C
@@ -0,0 +1,22 @@
+// Build don't link:
+
+int f1 () {
+ struct A {
+ A() : b (2) { }
+ fred () { return b.hi_mom; }
+ struct B {
+ int hi_mom;
+ B (int a) { hi_mom = a; }
+ };
+ B b;
+ };
+ A aa;
+ return aa.fred();
+}
+
+int f2 () {
+ struct A { ~A() { a = 3; } int a; fred () { return a + 1; } };
+ A ab;
+ ab.a = 12;
+ return ab.fred();
+}