<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 - Ternary operator with vector does not work with Apple Clang"
   href="https://bugs.llvm.org/show_bug.cgi?id=47216">47216</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Ternary operator with vector does not work with Apple Clang
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>10.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>C++17
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>bique.alexandre@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23857" name="attach_23857" title="clang-ternary-vector-bug.cc">attachment 23857</a> <a href="attachment.cgi?id=23857&action=edit" title="clang-ternary-vector-bug.cc">[details]</a></span>
clang-ternary-vector-bug.cc

Hi,

Ternary operator with vector does not work with Apple Clang:

bitmac-mini:tmp abique$ clang++ -std=c++17 clang-ternary-vector-bug.cc 
test.cc:10:11: error: value of type '__attribute__((__vector_size__(4 *
sizeof(int)))) int' (vector of 4 'int' values) is not contextually convertible
to 'bool'
  vec r = a < b ? a : b;
          ^~~~~
1 error generated.

bitmac-mini:tmp abique$ clang++ --version
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin


This works windows and linux.

Regards,
Alexandre</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>