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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.robertl/] [eb22.C] - Blame information for rev 305

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do assemble  }
2
// Ambiguous conversion, three candidates:
3
// builtin == (int, int), and the two user-defined operators
4
// Each one requires a user-defined ICS where another uses builtin conversions,
5
// so none is the best viable function.
6
 
7
class MyInt
8
{
9
public:
10
        MyInt(int = 0) {}
11
        operator int() const {return 2;}
12
};
13
 
14
bool operator==(const MyInt& a, const int& b)   // { dg-message "note" } candidate
15
{
16
        return (int)a == b;
17
}
18
 
19
bool operator==(const MyInt& a, const MyInt& b) // { dg-message "note" } candidate
20
{
21
        return (int)a == (int)b;
22
}
23
 
24
bool f()
25
{
26
  return 3 == MyInt();                          // { dg-error "ambiguous" "err" }
27
  // { dg-message "candidates" "note" { target *-*-* } 26 }
28
}

powered by: WebSVN 2.1.0

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