| 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 | #include <numbers> |
| 12 | |
| 13 | // Initializing the primary template is ill-formed. |
| 14 | int log2e{std::numbers::log2e_v<int>}; // expected-error-re@numbers:* {{static assertion failed{{.*}}A program that instantiates a primary template of a mathematical constant variable template is ill-formed.}} |
| 15 | int log10e{std::numbers::log10e_v<int>}; |
| 16 | int pi{std::numbers::pi_v<int>}; |
| 17 | int inv_pi{std::numbers::inv_pi_v<int>}; |
| 18 | int inv_sqrtpi{std::numbers::inv_sqrtpi_v<int>}; |
| 19 | int ln2{std::numbers::ln2_v<int>}; |
| 20 | int ln10{std::numbers::ln10_v<int>}; |
| 21 | int sqrt2{std::numbers::sqrt2_v<int>}; |
| 22 | int sqrt3{std::numbers::sqrt3_v<int>}; |
| 23 | int inv_sqrt3{std::numbers::inv_sqrt3_v<int>}; |
| 24 | int egamma{std::numbers::egamma_v<int>}; |
| 25 | int phi{std::numbers::phi_v<int>}; |
| 26 | |