diff options
author | Mark Mitchell <mark@codesourcery.com> | 1999-04-08 13:05:50 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1999-04-08 13:05:50 +0000 |
commit | 3fc5037bd1f8b59ab08315ff0fa3318b6324e3ba (patch) | |
tree | 7c51983ce1d5527dc6f48550f7c1b1170b35d1ea | |
parent | c86e69b2f952249f97b562c25050613fe0be40c1 (diff) | |
download | gcc-3fc5037bd1f8b59ab08315ff0fa3318b6324e3ba.zip gcc-3fc5037bd1f8b59ab08315ff0fa3318b6324e3ba.tar.gz gcc-3fc5037bd1f8b59ab08315ff0fa3318b6324e3ba.tar.bz2 |
* search.c (template_self_reference_p): Tweak.
From-SVN: r26296
-rw-r--r-- | gcc/cp/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/cp/init.c | 7 | ||||
-rw-r--r-- | gcc/cp/search.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/sizeof1.C | 12 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/crash34.C | 20 |
5 files changed, 45 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5dd9214..21cf5a9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,12 @@ +1999-04-08 Mark Mitchell <mark@codesourcery.com> + + * search.c (template_self_reference_p): Tweak. + +1999-04-07 Mark Mitchell <mark@codesourcery.com> + + * init.c (build_offset_ref): Don't build yet another weird data + structure to describe overloaded functions. + 1999-04-06 Mark Mitchell <mark@codesourcery.com> * cp-tree.h (BASELINK_P): New macro. diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 2769765..c51815f 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -1572,7 +1572,7 @@ build_offset_ref (type, name) /* A lot of this logic is now handled in lookup_field and lookup_fnfield. */ - if (member && TREE_CODE (member) == TREE_LIST) + if (member && BASELINK_P (member)) { /* Go from the TREE_BASELINK to the member function info. */ tree fnfields = member; @@ -1627,9 +1627,8 @@ build_offset_ref (type, name) && ! allocation_temporary_p ()) fnfields = copy_list (fnfields); - t = build_tree_list (error_mark_node, fnfields); - TREE_TYPE (t) = build_offset_type (type, unknown_type_node); - return t; + TREE_TYPE (fnfields) = build_offset_type (type, unknown_type_node); + return fnfields; } t = member; diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 7a13a9f..4b90e7e 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -1190,6 +1190,7 @@ template_self_reference_p (type, decl) tree decl; { return (CLASSTYPE_USE_TEMPLATE (type) + && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (type)) && TREE_CODE (decl) == TYPE_DECL && DECL_ARTIFICIAL (decl) && DECL_NAME (decl) == constructor_name (type)); diff --git a/gcc/testsuite/g++.old-deja/g++.other/sizeof1.C b/gcc/testsuite/g++.old-deja/g++.other/sizeof1.C new file mode 100644 index 0000000..6b547ae --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/sizeof1.C @@ -0,0 +1,12 @@ +// Build don't link: +// Origin: Jason Merrill <jason@cygnus.com> + +struct X { + int f (); + int f (int); +}; + +void f(int i) +{ + i = sizeof(X::f); // ERROR - cannot take sizeof a member function +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash34.C b/gcc/testsuite/g++.old-deja/g++.pt/crash34.C new file mode 100644 index 0000000..d178a40 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/crash34.C @@ -0,0 +1,20 @@ +// Build don't link: +// Origin: Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr> + +template <class T> +class A { +public: + class B { }; + class C: public B { + public: + C(A&):B() { } + }; + C f() { return C(*this); } +}; + +int +main() +{ + A<int> a; + a.f(); +} |