[llvm-bugs] [Bug 35174] New: clang-cl "cannot mangle this built-in __float128 type" due to promotions
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Nov 2 10:40:34 PDT 2017
https://bugs.llvm.org/show_bug.cgi?id=35174
Bug ID: 35174
Summary: clang-cl "cannot mangle this built-in __float128 type"
due to promotions
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: hans at chromium.org
CC: dgregor at apple.com, llvm-bugs at lists.llvm.org,
richard-llvm at metafoo.co.uk, rnk at google.com
$ 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 http://crbug.com/780311)
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171102/4cad2a03/attachment.html>
More information about the llvm-bugs
mailing list