Commit 8f2a734f by Nathan Sidwell Committed by Nathan Sidwell

cp: * search.c (lookup_conversion_operator): Avoid two loops.

	(add_conversions): Remove.
	(check_hidden_convs, split_conversions,
	lookup_conversions_r):	New.
	(lookup_conversions): Use lookup_conversions_r.
testsuite:
	* g++.dg/lookup/conv-[1234].C: New.

From-SVN: r85075
parent c29cac0b
2004-07-23 Nathan Sidwell <nathan@codesourcery.com>
* search.c (lookup_conversion_operator): Avoid two loops.
(add_conversions): Remove.
(check_hidden_convs, split_conversions,
lookup_conversions_r): New.
(lookup_conversions): Use lookup_conversions_r.
2004-07-22 Nathan Sidwell <nathan@codesourcery.com> 2004-07-22 Nathan Sidwell <nathan@codesourcery.com>
* pt.c (get_template_base): Check type is completable. * pt.c (get_template_base): Check type is completable.
......
2004-07-23 Nathan Sidwell <nathan@codesourcery.com>
* g++.dg/lookup/conv-[1234].C: New.
2004-07-22 Mark Mitchell <mark@codesourcery.com> 2004-07-22 Mark Mitchell <mark@codesourcery.com>
* g++.dg/parse/attr2.C: Simplify. * g++.dg/parse/attr2.C: Simplify.
......
// { dg-do compile }
// Copyright (C) 2004 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 21 Jul 2004 <nathan@codesourcery.com>
// Failed to spot ambiguous conversion
struct A1
{
operator int () const; // { dg-error "A1::operator" "" }
};
struct A2
{
operator int () const; // { dg-error "A2::operator" "" }
};
struct B : A1, A2
{
};
int Foo (B const &b)
{
return b; // { dg-error "ambiguous" "" }
}
// { dg-do compile }
// Copyright (C) 2004 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 21 Jul 2004 <nathan@codesourcery.com>
// { dg-final { scan-assembler "_ZNK2A1cviEv" } }
struct A1
{
operator int () const; // this one
};
struct A2 : A1
{
template<typename T> operator T () const;
};
int Foo (A2 const &b)
{
return b;
}
// { dg-do compile }
// Copyright (C) 2004 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 21 Jul 2004 <nathan@codesourcery.com>
// { dg-final { scan-assembler "_ZNK2A1IiEcviEv" } }
template <typename T> struct A1
{
operator T () const; // this one
};
struct A2 : A1<int>
{
template<typename T> operator T () const;
};
int Foo (A2 const &b)
{
return b;
}
// { dg-do compile }
// Copyright (C) 2004 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 21 Jul 2004 <nathan@codesourcery.com>
// { dg-final { scan-assembler "_ZNK1AcviEv" } }
// { dg-final { scan-assembler-not "_ZNK1VcviEv" } }
struct V
{
operator int () const;
};
struct A : virtual V
{
operator int () const; // this one
};
struct B1 : A, virtual V
{
};
struct B2 : virtual V, A
{
};
int Foo (B1 const &b)
{
return b;
}
int Foo (B2 const &b)
{
return b;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment