-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Closed as not planned
Closed as not planned
Copy link
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"duplicateResolved as duplicateResolved as duplicate
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.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"duplicateResolved as duplicateResolved as duplicate