aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/lookup.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/lookup.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/lookup.C30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/lookup.C b/gcc/testsuite/g++.old-deja/g++.jason/lookup.C
new file mode 100644
index 00000000000..c6c44c373d9
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.jason/lookup.C
@@ -0,0 +1,30 @@
+// PRMS Id: 4357
+// Bug: g++ forgets to clear out push/popclass cache stuff when instantiating
+// templates.
+// Build don't link:
+
+template <class T> class ccHandle { };
+
+class cc_GStack
+{
+ static cc_GStack* freeList;
+};
+
+// OK if ccGStack is not derived from ccHandle<something>
+class ccGStack : public ccHandle<int> { };
+
+struct S { };
+
+S* freeList;
+
+class X
+{
+public:
+ void foo();
+};
+
+void X::foo()
+{
+ S m;
+ freeList = &m;
+}