OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.robertl/] [eb22.C] - Diff between revs 149 and 154

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
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.