re PR c++/13178 (Bogus C++ error message referring to operator 1)

PR c++/13178
	* call.c (name_as_c_string): Print conversion operator names
	correctly.

	PR c++/13178
	* g++.dg/conversion/op1.C: New test.

From-SVN: r75986
This commit is contained in:
Mark Mitchell 2004-01-16 18:39:58 +00:00 committed by Mark Mitchell
parent 9e0baa6041
commit 144e414d26
4 changed files with 28 additions and 0 deletions

View File

@ -1,5 +1,9 @@
2004-01-16 Mark Mitchell <mark@codesourcery.com>
PR c++/13178
* call.c (name_as_c_string): Print conversion operator names
correctly.
PR c++/13478
* call.c (initialize_reference): Pass -1 for inner parameter to
convert_like_real.

View File

@ -4986,6 +4986,15 @@ name_as_c_string (tree name, tree type, bool *free_p)
*free_p = true;
}
}
else if (IDENTIFIER_TYPENAME_P (name))
{
pretty_name = concat ("operator ",
type_as_string (TREE_TYPE (name),
TFF_PLAIN_IDENTIFIER),
NULL);
/* Remember that we need to free the memory allocated. */
*free_p = true;
}
else
pretty_name = (char *) IDENTIFIER_POINTER (name);

View File

@ -1,3 +1,8 @@
2004-01-16 Mark Mitchell <mark@codesourcery.com>
PR c++/13178
* g++.dg/conversion/op1.C: New test.
2004-01-16 J"orn Rennecke <joern.rennecke@superh.com>
PR 10392

View File

@ -0,0 +1,10 @@
class C
{
template<typename U>
operator U();
};
int fn (C c)
{
return C::operator float(c); // { dg-error "operator U" }
}