<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 - clang-cl "cannot mangle this built-in __float128 type" due to promotions"
   href="https://bugs.llvm.org/show_bug.cgi?id=35174">35174</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang-cl "cannot mangle this built-in __float128 type" due to promotions
          </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>Linux
          </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>C++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>hans@chromium.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk, rnk@google.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>$ cat /tmp/a.cc
template <bool> struct B;
template <class T> constexpr bool is_floating_point_v = false;

struct StrictNumeric {
  StrictNumeric(int);
  template <typename Dst, B<is_floating_point_v<Dst>> = nullptr> operator
Dst();
};

static_assert(StrictNumeric(1) > 0);

$ bin/clang -cc1 -triple i686-pc-win32 /tmp/a.cc -std=c++17 -emit-obj

error: cannot mangle this built-in __float128 type yet
/tmp/a.cc:9:32: error: invalid operands to binary expression ('StrictNumeric'
and 'int')
static_assert(StrictNumeric(1) > 0);
              ~~~~~~~~~~~~~~~~ ^ ~
2 errors generated.


Note that the source never mentions __float128, but Clang tries to use it when
it tries to find a conversion of the StrictNumeric that works with the >
expression. In the process, it instantiates is_floating_point_v<__float128>,
causing the mangling error.


Should BuiltinOperatorOverloadBuilder::addGenericBinaryArithmeticOverloads()
only consider types that are valid for the target?

(We hit this in Chromium with the latest MS SDK; see <a href="http://crbug.com/780311">http://crbug.com/780311</a>)</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>