<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - i/o stream of based enum gives ambiguity error"
   href="https://llvm.org/bugs/show_bug.cgi?id=26431">26431</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>i/o stream of based enum gives ambiguity error
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ivan@millcomputing.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This source:
#include    <iostream>
enum foo : short  {};
extern foo bar;
int main(int argc, char** argv) {
    std::cerr << bar;
    return 0;
    }
when compiled with:
s8:~/mill/specializer$ clang  -std=c++11 -v
clang version 3.7.0 (branches/release_37 242873)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.9.2
Selected GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.9.2
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64

gives this diagnostic:

test.cc:6:12: error: use of overloaded operator '<<' is ambiguous (with operand
      types 'ostream' (aka 'basic_ostream<char>') and 'foo')
        std::cerr << bar;
        ~~~~~~~~~ ^  ~~~
/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../include/c++/4.9.2/ostream:178:7:
note:
      candidate function
      operator<<(short __n);
      ^
/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../include/c++/4.9.2/ostream:189:7:
note:
      candidate function
      operator<<(int __n);
      ^
/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../include/c++/4.9.2/ostream:166:7:
note:
      candidate function
      operator<<(long __n)
      ^
/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../include/c++/4.9.2/ostream:170:7:
note:
      candidate function
      operator<<(unsigned long __n)
      ^
/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../include/c++/4.9.2/ostream:174:7:
note:
      candidate function
      operator<<(bool __n)
      ^
/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../include/c++/4.9.2/ostream:181:7:
note:
      candidate function
      operator<<(unsigned short __n)
      ^
/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../include/c++/4.9.2/ostream:192:7:
note:
      candidate function
      operator<<(unsigned int __n)
      ^
/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../include/c++/4.9.2/ostream:201:7:
note:
      candidate function
      operator<<(long long __n)
      ^
/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../include/c++/4.9.2/ostream:205:7:
note:
      candidate function
      operator<<(unsigned long long __n)
      ^
/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../include/c++/4.9.2/ostream:220:7:
note:
      candidate function
      operator<<(double __f)
      ^
/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../include/c++/4.9.2/ostream:224:7:
note:
      candidate function
      operator<<(float __f)
      ^
/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../include/c++/4.9.2/ostream:232:7:
note:
      candidate function
      operator<<(long double __f)
      ^
/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../include/c++/4.9.2/ostream:482:5:
note:
      candidate function [with _Traits = std::char_traits<char>]
    operator<<(basic_ostream<char, _Traits>& __out, char __c)
    ^
/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../include/c++/4.9.2/ostream:476:5:
note:
      candidate function [with _CharT = char, _Traits = std::char_traits<char>]
    operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
    ^
/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../include/c++/4.9.2/ostream:488:5:
note:
      candidate function [with _Traits = std::char_traits<char>]
    operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
    ^
/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../include/c++/4.9.2/ostream:493:5:
note:
      candidate function [with _Traits = std::char_traits<char>]
    operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
    ^
1 error generated.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>