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: unassignedclangb...@nondot.org
          Reporter: h...@chromium.org
                CC: dgre...@apple.com, llvm-bugs@lists.llvm.org,
                    richard-l...@metafoo.co.uk, r...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to