* search.c (template_self_reference_p): Tweak.
From-SVN: r26296
This commit is contained in:
parent
c86e69b2f9
commit
3fc5037bd1
|
@ -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>
|
1999-04-06 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
* cp-tree.h (BASELINK_P): New macro.
|
* cp-tree.h (BASELINK_P): New macro.
|
||||||
|
|
|
@ -1572,7 +1572,7 @@ build_offset_ref (type, name)
|
||||||
|
|
||||||
/* A lot of this logic is now handled in lookup_field and
|
/* A lot of this logic is now handled in lookup_field and
|
||||||
lookup_fnfield. */
|
lookup_fnfield. */
|
||||||
if (member && TREE_CODE (member) == TREE_LIST)
|
if (member && BASELINK_P (member))
|
||||||
{
|
{
|
||||||
/* Go from the TREE_BASELINK to the member function info. */
|
/* Go from the TREE_BASELINK to the member function info. */
|
||||||
tree fnfields = member;
|
tree fnfields = member;
|
||||||
|
@ -1627,9 +1627,8 @@ build_offset_ref (type, name)
|
||||||
&& ! allocation_temporary_p ())
|
&& ! allocation_temporary_p ())
|
||||||
fnfields = copy_list (fnfields);
|
fnfields = copy_list (fnfields);
|
||||||
|
|
||||||
t = build_tree_list (error_mark_node, fnfields);
|
TREE_TYPE (fnfields) = build_offset_type (type, unknown_type_node);
|
||||||
TREE_TYPE (t) = build_offset_type (type, unknown_type_node);
|
return fnfields;
|
||||||
return t;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
t = member;
|
t = member;
|
||||||
|
|
|
@ -1190,6 +1190,7 @@ template_self_reference_p (type, decl)
|
||||||
tree decl;
|
tree decl;
|
||||||
{
|
{
|
||||||
return (CLASSTYPE_USE_TEMPLATE (type)
|
return (CLASSTYPE_USE_TEMPLATE (type)
|
||||||
|
&& PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (type))
|
||||||
&& TREE_CODE (decl) == TYPE_DECL
|
&& TREE_CODE (decl) == TYPE_DECL
|
||||||
&& DECL_ARTIFICIAL (decl)
|
&& DECL_ARTIFICIAL (decl)
|
||||||
&& DECL_NAME (decl) == constructor_name (type));
|
&& DECL_NAME (decl) == constructor_name (type));
|
||||||
|
|
|
@ -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
|
||||||
|
}
|
|
@ -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();
|
||||||
|
}
|
Loading…
Reference in New Issue