[PATCH] D39579: BuiltinOperatorOverloadBuilder: Don't consider types that are unavailable on the target (PR35174)

Hans Wennborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 6 17:43:56 PST 2017

hans marked 2 inline comments as done.
hans added inline comments.

Comment at: test/CodeGenCXX/microsoft-cannot-mangle-float128.cpp:3-11
+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();
rsmith wrote:
> This seems like a fragile way of checking for the bug; I'd prefer a test that tests `Sema` rather than code generation. For instance, how about a class with a conversion operator that converts to `T` with an `enable_if` disabling it for `float`, `double`, and `long double`, and a check that an instance of such a class can't be used in floating-point arithmetic?
Thanks! That sounds like a good plan.


More information about the cfe-commits mailing list