26 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// UNSUPPORTED: c++03, c++11, c++14, c++1710 11#include <numbers>12 13// Initializing the primary template is ill-formed.14int 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.}}15int log10e{std::numbers::log10e_v<int>};16int pi{std::numbers::pi_v<int>};17int inv_pi{std::numbers::inv_pi_v<int>};18int inv_sqrtpi{std::numbers::inv_sqrtpi_v<int>};19int ln2{std::numbers::ln2_v<int>};20int ln10{std::numbers::ln10_v<int>};21int sqrt2{std::numbers::sqrt2_v<int>};22int sqrt3{std::numbers::sqrt3_v<int>};23int inv_sqrt3{std::numbers::inv_sqrt3_v<int>};24int egamma{std::numbers::egamma_v<int>};25int phi{std::numbers::phi_v<int>};26