mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-24 12:02:36 +08:00
cmath: Support clang's -fdelayed-template-parsing
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
This commit is contained in:
@@ -23,9 +23,9 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
static_assert(std::__libcpp_isnan(0.) == false, "");
|
||||
static_assert(std::__libcpp_isinf(0.0) == false, "");
|
||||
static_assert(std::__libcpp_isfinite(0.0) == true, "");
|
||||
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()
|
||||
{
|
||||
|
||||
28
test/libcxx/numerics/c.math/fdelayed-template-parsing.sh.cpp
Normal file
28
test/libcxx/numerics/c.math/fdelayed-template-parsing.sh.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// test that cmath builds with -fdelayed-template-parsing
|
||||
|
||||
// REQUIRES: fdelayed-template-parsing
|
||||
|
||||
// RUN: %build -fdelayed-template-parsing
|
||||
// RUN: %run
|
||||
|
||||
#include <cmath>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main() {
|
||||
assert(std::isfinite(1.0));
|
||||
assert(!std::isinf(1.0));
|
||||
assert(!std::isnan(1.0));
|
||||
}
|
||||
|
||||
using namespace std;
|
||||
Reference in New Issue
Block a user