aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorMark Mitchell <mark@markmitchell.com>1998-12-14 15:35:40 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1998-12-14 15:35:40 +0000
commitd8f8dca15f590c4f7514d43c4b2a6c61270ea7fa (patch)
treed7dd59c9ebbb858ab3253584bc6ce63646ceb126 /gcc/testsuite
parent11b8962251b584202478b1d3d0d2413f6d335dd4 (diff)
downloadgcc-d8f8dca15f590c4f7514d43c4b2a6c61270ea7fa.zip
gcc-d8f8dca15f590c4f7514d43c4b2a6c61270ea7fa.tar.gz
gcc-d8f8dca15f590c4f7514d43c4b2a6c61270ea7fa.tar.bz2
class.c (pushclass): Tweak handling of class-level bindings.
* class.c (pushclass): Tweak handling of class-level bindings. (resolve_address_of_overloaded_function): Update pointer-to-member handling. (instantiate_type): Likewise. * cvt.c (cp_convert_to_pointer): Likewise. * decl.c (pop_binding): Take the DECL to pop, not just the name. Deal with `struct stat' hack. (binding_level): Add to documentation. (push_binding): Clear BINDING_TYPE. (add_binding): New function. (push_local_binding): Use it. (push_class_binding): Likewise. (poplevel): Adjust calls to pop_binding. (poplevel_class): Likewise. (pushdecl): Adjust handling of TYPE_DECLs; add bindings for hidden declarations to current binding level. (push_class_level_binding): Likewise. (push_overloaded_decl): Adjust handling of OVERLOADs in local bindings. (lookup_namespace_name): Don't crash when confronted with a TEMPLATE_DECL. (lookup_name_real): Do `struct stat' hack in local binding contexts. (build_ptrmemfunc_type): Adjust documentation. (grokdeclarator): Don't avoid building real array types when processing templates unless really necessary. (finish_method): Adjust calls to pop_binding. * decl2.c (reparse_absdcl_as_expr): Recursively call ourselves, not reparse_decl_as_expr. (build_expr_from_tree): Deal with a template-id as the function to call in a METHOD_CALL_EXPR. * pt.c (convert_nontype_argument): Tweak pointer-to-member handling. (maybe_adjust_types_For_deduction): Don't do peculiar things with METHOD_TYPEs here. (resolve_overloaded_unification): Handle COMPONENT_REFs. Build pointer-to-member types where necessary. * tree.c (build_cplus_array_type_1): Don't avoid building real array types when processing templates unless really necessary. (build_exception_variant): Compare the exception lists correctly. From-SVN: r24314
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.eh/tmpl3.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ns/crash3.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/expr1.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup8.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/array2.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/memtemp81.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/overload11.C27
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/ptrmem4.C28
8 files changed, 120 insertions, 5 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.eh/tmpl3.C b/gcc/testsuite/g++.old-deja/g++.eh/tmpl3.C
index 738e7d8..521315e 100644
--- a/gcc/testsuite/g++.old-deja/g++.eh/tmpl3.C
+++ b/gcc/testsuite/g++.old-deja/g++.eh/tmpl3.C
@@ -3,9 +3,9 @@
// Posted by Trevor Taylor <ttaylor@powerup.com.au>
template<class T> struct A {
- void X() throw(T); // gets bogus error - previous decl - XFAIL *-*-*
+ void X() throw(T);
};
template<class T>
inline void A<T>::X()
-throw(T) { } // gets bogus error - different throws - XFAIL *-*-*
+throw(T) { }
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/crash3.C b/gcc/testsuite/g++.old-deja/g++.ns/crash3.C
new file mode 100644
index 0000000..842ed09
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ns/crash3.C
@@ -0,0 +1,10 @@
+// Build don't link:
+
+namespace N {
+ template <class T> struct S;
+};
+
+void f()
+{
+ N::S(); // ERROR - invalid use of template
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/expr1.C b/gcc/testsuite/g++.old-deja/g++.other/expr1.C
index 0f5fdcf..fece8d4 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/expr1.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/expr1.C
@@ -1,11 +1,9 @@
// Build don't link:
-// crash test - XFAIL *-*-*
-
// Simplified from bug report by Trevor Taylor <ttaylor@powerup.com.au>
struct T {
- int operator()(int) { }
+ int operator()(int) { } // ERROR - candidate
};
int main() {
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup8.C b/gcc/testsuite/g++.old-deja/g++.other/lookup8.C
new file mode 100644
index 0000000..f81572a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup8.C
@@ -0,0 +1,14 @@
+// Build don't link:
+
+struct S {
+ int A;
+ struct A {
+ enum { a = 0 };
+ };
+
+ void f();
+};
+
+void S::f() {
+ A = A::a;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/array2.C b/gcc/testsuite/g++.old-deja/g++.pt/array2.C
new file mode 100644
index 0000000..6c5810e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/array2.C
@@ -0,0 +1,14 @@
+// Build don't link:
+
+template<int N, class C>
+class Bar {};
+
+template<class C>
+class Huh {};
+
+template<int N>
+void foo(const Bar<N,Huh<float[1]> > &x) {}
+
+int main() {
+ foo(Bar<3,Huh<float[1]> >());
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp81.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp81.C
new file mode 100644
index 0000000..1584f88
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp81.C
@@ -0,0 +1,24 @@
+// Build don't link:
+
+template <int i> class a
+{
+public :
+int k;
+
+template <int j> int f() const { return this->f<j-1>(); }
+
+int g() const { return f<i>(); };
+};
+
+template <>
+template <>
+int a<2>::f<0>() const {
+ return 0;
+}
+
+int main()
+{
+a<2> x;
+return x.g();
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/overload11.C b/gcc/testsuite/g++.old-deja/g++.pt/overload11.C
new file mode 100644
index 0000000..300d91e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/overload11.C
@@ -0,0 +1,27 @@
+// Build don't run:
+
+template <class T>
+int f(int (*fn)(T))
+{
+ return (*fn)(3);
+}
+
+struct S {
+ static int g(int) { return 1; }
+ static void g();
+
+ int h();
+};
+
+int S::h()
+{
+ return f(&g);
+}
+
+
+int main()
+{
+ S s;
+ if (s.h () != 1)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ptrmem4.C b/gcc/testsuite/g++.old-deja/g++.pt/ptrmem4.C
new file mode 100644
index 0000000..139be92
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/ptrmem4.C
@@ -0,0 +1,28 @@
+// Build don't run:
+
+template<class T,class T1>
+int connect_to_method(T* receiver,
+ int (T1::*method)())
+{
+ return (receiver->*method)();
+}
+
+class Gtk_Container
+{
+public:
+ int remove_callback() { return 1; }
+ void remove_callback(int);
+ int f();
+};
+
+int Gtk_Container::f()
+{
+ return connect_to_method(this, &Gtk_Container::remove_callback);
+}
+
+int main()
+{
+ Gtk_Container gc;
+ if (gc.f () != 1)
+ return 1;
+}