<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 - Three way comparator complains "zero as null pointer constant""
   href="https://bugs.llvm.org/show_bug.cgi?id=46803">46803</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Three way comparator complains "zero as null pointer constant"
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>10.0
          </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>C++2a
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>gumby@henkel-wallace.org
          </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>Bug in clang++10.0.1 libc++ installed via apt-get from your repo.
Identical on MacOS 10.15 with homebrew clang++10
Or Godbolt.

Compile following program doing `clang++-10 -std=c++20
-Wzero-as-null-pointer-constant`

#include <iostream>
#include <compare>

int main () {
  bool result { (1 <=> 2) < 0 };
  std::cout << (result ? "Yes" : "No") << std::endl;
}

produces the error:

   foo.cc:5:27: warning: zero as null pointer constant
[-Wzero-as-null-pointer-constant]

Also compiler-synthesized comparisons will generate this which is especially
confusing as they can happen when calling a library function that needs the '<'
operator.</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>