URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
// { dg-do assemble }
|
// { dg-do assemble }
|
// Ambiguous conversion, three candidates:
|
// Ambiguous conversion, three candidates:
|
// builtin == (int, int), and the two user-defined operators
|
// builtin == (int, int), and the two user-defined operators
|
// Each one requires a user-defined ICS where another uses builtin conversions,
|
// Each one requires a user-defined ICS where another uses builtin conversions,
|
// so none is the best viable function.
|
// so none is the best viable function.
|
|
|
class MyInt
|
class MyInt
|
{
|
{
|
public:
|
public:
|
MyInt(int = 0) {}
|
MyInt(int = 0) {}
|
operator int() const {return 2;}
|
operator int() const {return 2;}
|
};
|
};
|
|
|
bool operator==(const MyInt& a, const int& b) // { dg-error "" } candidate
|
bool operator==(const MyInt& a, const int& b) // { dg-error "" } candidate
|
{
|
{
|
return (int)a == b;
|
return (int)a == b;
|
}
|
}
|
|
|
bool operator==(const MyInt& a, const MyInt& b) // { dg-error "" } candidate
|
bool operator==(const MyInt& a, const MyInt& b) // { dg-error "" } candidate
|
{
|
{
|
return (int)a == (int)b;
|
return (int)a == (int)b;
|
}
|
}
|
|
|
bool f()
|
bool f()
|
{
|
{
|
return 3 == MyInt(); // { dg-error "" } ambiguous
|
return 3 == MyInt(); // { dg-error "" } ambiguous
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.