xref: /llvm-project/libcxx/test/std/language.support/cmp/cmp.alg/strong_order_long_double.verify.cpp (revision c792de28dfaf3a13703e83e4eb09dd44574b3a3e)
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // UNSUPPORTED: c++03, c++11, c++14, c++17
10 
11 // <compare>
12 
13 // template<class T> constexpr strong_ordering strong_order(const T& a, const T& b);
14 
15 // libc++ does not support strong_order(long double, long double) quite yet.
16 // This test verifies the error message we give for that case.
17 // TODO: remove this test once long double is properly supported.
18 
19 #include <compare>
20 
21 #include "test_macros.h"
22 
23 void f() {
24     long double ld = 3.14;
25 #ifdef TEST_LONG_DOUBLE_IS_DOUBLE
26     (void)ld; // expected-no-diagnostics
27 #else
28     (void)std::strong_order(ld, ld);  // expected-error@*:* {{std::strong_order is unimplemented for this floating-point type}}
29 #endif
30 }
31