[LLVMbugs] [Bug 8432] New: char16_t, char32_t having trouble with op==

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Oct 21 09:26:10 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=8432

           Summary: char16_t, char32_t having trouble with op==
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++0x
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: hhinnant at apple.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


This program fails to compile with -std=c++0x


template <class T>
struct X
{
    operator T() const {return T();}
};

int main()
{
    typedef char16_t T;
    X<T> x;
    bool b = x == T();
}

The program works if wchar_t is used instead of char16_t or char32_t.  The
error message is below:


test.cpp:11:16: error: use of overloaded operator '==' is ambiguous
    bool b = x == T();
             ~ ^  ~~~
test.cpp:11:16: note: built-in candidate operator==(float, float)
test.cpp:11:16: note: built-in candidate operator==(float, unsigned long long)
test.cpp:11:16: note: built-in candidate operator==(float, unsigned long)
test.cpp:11:16: note: built-in candidate operator==(float, unsigned int)
test.cpp:11:16: note: built-in candidate operator==(float, long long)
test.cpp:11:16: note: built-in candidate operator==(float, long)
test.cpp:11:16: note: built-in candidate operator==(float, int)
test.cpp:11:16: note: built-in candidate operator==(unsigned long long, long
double)
test.cpp:11:16: note: built-in candidate operator==(unsigned long long, double)
test.cpp:11:16: note: built-in candidate operator==(unsigned long long, float)
test.cpp:11:16: note: built-in candidate operator==(unsigned long long,
unsigned long long)
test.cpp:11:16: note: built-in candidate operator==(unsigned long long,
unsigned long)
test.cpp:11:16: note: built-in candidate operator==(unsigned long long,
unsigned int)
test.cpp:11:16: note: built-in candidate operator==(unsigned long long, long
long)
test.cpp:11:16: note: built-in candidate operator==(unsigned long long, long)
test.cpp:11:16: note: built-in candidate operator==(unsigned long long, int)
test.cpp:11:16: note: built-in candidate operator==(unsigned long, long double)
test.cpp:11:16: note: built-in candidate operator==(unsigned long, double)
test.cpp:11:16: note: built-in candidate operator==(unsigned long, float)
test.cpp:11:16: note: built-in candidate operator==(unsigned long, unsigned
long long)
test.cpp:11:16: note: built-in candidate operator==(long double, long double)
test.cpp:11:16: note: built-in candidate operator==(long double, double)
test.cpp:11:16: note: built-in candidate operator==(long double, float)
test.cpp:11:16: note: built-in candidate operator==(long double, unsigned long
long)
test.cpp:11:16: note: built-in candidate operator==(long double, unsigned long)
test.cpp:11:16: note: built-in candidate operator==(long double, unsigned int)
test.cpp:11:16: note: built-in candidate operator==(long double, long long)
test.cpp:11:16: note: built-in candidate operator==(long double, long)
test.cpp:11:16: note: built-in candidate operator==(long double, int)
test.cpp:11:16: note: built-in candidate operator==(double, long double)
test.cpp:11:16: note: built-in candidate operator==(double, double)
test.cpp:11:16: note: built-in candidate operator==(double, float)
test.cpp:11:16: note: built-in candidate operator==(double, unsigned long long)
test.cpp:11:16: note: built-in candidate operator==(double, unsigned long)
test.cpp:11:16: note: built-in candidate operator==(double, unsigned int)
test.cpp:11:16: note: built-in candidate operator==(double, long long)
test.cpp:11:16: note: built-in candidate operator==(double, long)
test.cpp:11:16: note: built-in candidate operator==(double, int)
test.cpp:11:16: note: built-in candidate operator==(float, long double)
test.cpp:11:16: note: built-in candidate operator==(float, double)
test.cpp:11:16: note: built-in candidate operator==(long long, long)
test.cpp:11:16: note: built-in candidate operator==(long long, int)
test.cpp:11:16: note: built-in candidate operator==(long, long double)
test.cpp:11:16: note: built-in candidate operator==(long, double)
test.cpp:11:16: note: built-in candidate operator==(long, float)
test.cpp:11:16: note: built-in candidate operator==(long, unsigned long long)
test.cpp:11:16: note: built-in candidate operator==(long, unsigned long)
test.cpp:11:16: note: built-in candidate operator==(long, unsigned int)
test.cpp:11:16: note: built-in candidate operator==(long, long long)
test.cpp:11:16: note: built-in candidate operator==(long, long)
test.cpp:11:16: note: built-in candidate operator==(long, int)
test.cpp:11:16: note: built-in candidate operator==(int, long double)
test.cpp:11:16: note: built-in candidate operator==(int, double)
test.cpp:11:16: note: built-in candidate operator==(int, float)
test.cpp:11:16: note: built-in candidate operator==(int, unsigned long long)
test.cpp:11:16: note: built-in candidate operator==(int, unsigned long)
test.cpp:11:16: note: built-in candidate operator==(int, unsigned int)
test.cpp:11:16: note: built-in candidate operator==(int, long long)
test.cpp:11:16: note: built-in candidate operator==(int, long)
test.cpp:11:16: note: built-in candidate operator==(int, int)
test.cpp:11:16: note: built-in candidate operator==(unsigned long, unsigned
long)
test.cpp:11:16: note: built-in candidate operator==(unsigned long, unsigned
int)
test.cpp:11:16: note: built-in candidate operator==(unsigned long, long long)
test.cpp:11:16: note: built-in candidate operator==(unsigned long, long)
test.cpp:11:16: note: built-in candidate operator==(unsigned long, int)
test.cpp:11:16: note: built-in candidate operator==(unsigned int, long double)
test.cpp:11:16: note: built-in candidate operator==(unsigned int, double)
test.cpp:11:16: note: built-in candidate operator==(unsigned int, float)
test.cpp:11:16: note: built-in candidate operator==(unsigned int, unsigned long
long)
test.cpp:11:16: note: built-in candidate operator==(unsigned int, unsigned
long)
test.cpp:11:16: note: built-in candidate operator==(unsigned int, unsigned int)
test.cpp:11:16: note: built-in candidate operator==(unsigned int, long long)
test.cpp:11:16: note: built-in candidate operator==(unsigned int, long)
test.cpp:11:16: note: built-in candidate operator==(unsigned int, int)
test.cpp:11:16: note: built-in candidate operator==(long long, long double)
test.cpp:11:16: note: built-in candidate operator==(long long, double)
test.cpp:11:16: note: built-in candidate operator==(long long, float)
test.cpp:11:16: note: built-in candidate operator==(long long, unsigned long
long)
test.cpp:11:16: note: built-in candidate operator==(long long, unsigned long)
test.cpp:11:16: note: built-in candidate operator==(long long, unsigned int)
test.cpp:11:16: note: built-in candidate operator==(long long, long long)
1 error generated.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list