r283051 added some functions to cmath (in namespace std) that have the same name as functions in math.h (in the global namespace). Clang's limited support for `-fdelayed-template-parsing` chokes on this. Rename the ones in `cmath` and their uses in `complex` and the test. rdar://problem/32848355 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@307357 91177308-0d34-0410-b5e6-96231b3b80d8
33 lines
1.1 KiB
C++
33 lines
1.1 KiB
C++
//===----------------------------------------------------------------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
// Source Licenses. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Check that the overloads of std::__libcpp_{isnan,isinf,isfinite} that take
|
|
// floating-point values are evaluatable from constexpr contexts.
|
|
//
|
|
// These functions need to be constexpr in order to be called from CUDA, see
|
|
// https://reviews.llvm.org/D25403. They don't actually need to be
|
|
// constexpr-evaluatable, but that's what we check here, since we can't check
|
|
// true constexpr-ness.
|
|
//
|
|
// This fails with gcc because __builtin_isnan and friends, which libcpp_isnan
|
|
// and friends call, are not themselves constexpr-evaluatable.
|
|
//
|
|
// UNSUPPORTED: c++98, c++03
|
|
// XFAIL: gcc
|
|
|
|
#include <cmath>
|
|
|
|
static_assert(std::__libcpp_isnan_or_builtin(0.) == false, "");
|
|
static_assert(std::__libcpp_isinf_or_builtin(0.0) == false, "");
|
|
static_assert(std::__libcpp_isfinite_or_builtin(0.0) == true, "");
|
|
|
|
int main()
|
|
{
|
|
}
|