<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - [C++] Use of vectors is ternary"
   href="https://bugs.llvm.org/show_bug.cgi?id=48101">48101</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[C++] Use of vectors is ternary
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>OpenCL
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>anastasia.stulova@arm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>anastasia.stulova@arm.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This seems to be related to <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Ternary operator not supported using OpenCL style vectors in C++ program while docs imply this is supported."
   href="show_bug.cgi?id=33103">https://bugs.llvm.org/show_bug.cgi?id=33103</a> but
however it doesn't cover OpenCL code. The change can probably be done
uniformaly.

The main issue is that in C++ condition of ternary operators is contextually
converted to bool while in C they can be any scalar type. This seems to be an
issue because OpenCL doesn't have a bool type for vectors, but however booln is
a reserved identifier.

To allow this potentially some work is needed on the language side first i.e.
could we introduce booln type or could we convert vector types to bool? The
latter potentially means that the behavior between OpenCL C and C++ for OpenCL
is not strickly backward compatible.</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>