Bug ID: 31229
           Summary: ambiguous operator<< for c++11 enum of type bool
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
    Classification: Unclassified

The following code does not compile with any clang version I have tested:

#include <iostream>

enum A : bool {
    Yup = true,
    Nop = false,

int main() { 
    A t = Yup;
    std::cout << t;

This is the error:

error: use of overloaded operator '<<' is ambiguous (with operand types
'ostream' (aka 'basic_ostream<char>') and 'A')

Here is a link to an online compiler:

This issue is non-existent with gcc.

Hope this is not a duplicate... first bug report here.

You are receiving this mail because:
You are on the CC list for the bug.
llvm-bugs mailing list

Reply via email to