Closed as not planned
Closed as not planned
Description
Bugzilla Link | 36226 |
Version | trunk |
OS | Windows NT |
Reporter | LLVM Bugzilla Contributor |
CC | @DougGregor |
Extended Description
The following code snippet (to my knowledge) should be rejected because the overload resolution can't cope with the ambiguity of which operator() to call. This ambiguity is described in [class.member.lookup] section of the C++ standard.
#include <iostream>
using namespace std;
struct IntPrinter
{
void operator()(int i)
{
}
};
class FloatPrinter
{
public:
void operator()(float f)
{
}
};
struct Printer: IntPrinter, FloatPrinter
{
};
int main()
{
Printer printer;
printer(55);
printer(55.1f);
};
The code compiles fine but should fail to compile. It doesn't compile on gcc.