-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Description
| Bugzilla Link | 35174 |
| Resolution | FIXED |
| Resolved on | Nov 15, 2017 09:12 |
| Version | trunk |
| OS | Linux |
| CC | @DougGregor,@dpxf,@zygoloid,@rnk |
Extended Description
$ cat /tmp/a.cc
template struct B;
template constexpr bool is_floating_point_v = false;
struct StrictNumeric {
StrictNumeric(int);
template <typename Dst, B<is_floating_point_v> = 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 http://crbug.com/780311)