mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-08 09:50:38 +08:00
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:
parent
9e0baa6041
commit
144e414d26
@ -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.
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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
|
||||
|
10
gcc/testsuite/g++.dg/conversion/op1.C
Normal file
10
gcc/testsuite/g++.dg/conversion/op1.C
Normal 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" }
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user