This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

patch that caused regression PR c++/8702


The regression reported in PR c++/8702 showed up starting with this
patch:

2002-03-16  Nathan Sidwell  <nathan@codesourcery.com>

	PR c++/4361
	* cp-tree.h (CLASSTYPE_METHOD_VEC): Document where templated
	conversion operators go.
	(struct lang_decl_flags): Add template_conv_p and unused
	bitfields.
	(DECL_TEMPLATE_CONV_FN_P): New macro.
	* call.c (build_user_type_conversion_1): Don't check second type
	conversion of overload set first.
	* class.c (add_method): Make sure templated conversion operators
	all end up on slot 2.
	* lex.c (do_identifier): A conversion operator token might be
	satisfied by a templated conversion operator.
	* mangle.c (struct globals) Add internal_mangling_p member.
	(write_template_param): Do internal mangling, if needed.
	(mangle_conv_op_name_for_type): Request internal mangling.
	* pt.c (check_explicit_specialization): Use
	CLASSTYPE_FIRST_CONVERSION_SLOT.
	(template_parm_this_level_p): New function.
	(push_template_decl_real): Determine DECL_TEMPLATE_CONV_FN_P.
	* search.c (lookup_fn_fields_1): Template conversions will be on
	the first slot.
	* typeck.c (build_component_ref): Preserve the type of an
	conversion operator name on the overload type.
	(build_x_function_call): Retrieve the conversion operator name.

Here's a small test case that causes the valid code to be rejected.
This occurs in the mainline and the 3.3 branch.

---------------
template <typename X> struct C1{};
     
template <typename X>
struct C2 {
  template<typename Y> operator C1<Y>();
  template<typename Y> operator C2<Y>();
};


template<typename X> template<typename Y>
C2<X>::operator C1<Y>()
{
  return C1<Y>();
}
---------------

Output from the compiler:

8702.C:12: error: no `C2<X>::operator C1<Y>()' member function declared in
   class `C2<X>'
8702.C:12: error: template definition of non-template `C2<X>::operator C1<Y>()'

I'll add this information to the PR.

Janis


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]