eb22.c
来自「Mac OS X 10.4.9 for x86 Source Code gcc」· C语言 代码 · 共 28 行
C
28 行
// { dg-do assemble }// Ambiguous conversion, three candidates:// builtin == (int, int), and the two user-defined operators// Each one requires a user-defined ICS where another uses builtin conversions,// so none is the best viable function.class MyInt{public: MyInt(int = 0) {} operator int() const {return 2;}};bool operator==(const MyInt& a, const int& b) // { dg-error "" } candidate{ return (int)a == b;}bool operator==(const MyInt& a, const MyInt& b) // { dg-error "" } candidate{ return (int)a == (int)b;}bool f(){ return 3 == MyInt(); // { dg-error "" } ambiguous}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?