mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-24 03:32:35 +08:00
Remove usages of _LIBCPP_CONSTEXPR under test/std
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@284002 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -17,6 +17,8 @@
|
|||||||
#include <random>
|
#include <random>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
#include "test_macros.h"
|
||||||
|
|
||||||
template <class UIntType, UIntType Min, UIntType Max>
|
template <class UIntType, UIntType Min, UIntType Max>
|
||||||
class rand1
|
class rand1
|
||||||
{
|
{
|
||||||
@@ -30,14 +32,14 @@ private:
|
|||||||
static_assert(Min < Max, "rand1 invalid parameters");
|
static_assert(Min < Max, "rand1 invalid parameters");
|
||||||
public:
|
public:
|
||||||
|
|
||||||
#ifdef _LIBCPP_HAS_NO_CONSTEXPR
|
#if TEST_STD_VER < 11 && defined(_LIBCPP_VERSION)
|
||||||
// Workaround for lack of constexpr in C++03
|
// Workaround for lack of constexpr in C++03
|
||||||
static const result_type _Min = Min;
|
static const result_type _Min = Min;
|
||||||
static const result_type _Max = Max;
|
static const result_type _Max = Max;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static _LIBCPP_CONSTEXPR result_type min() {return Min;}
|
static TEST_CONSTEXPR result_type min() {return Min;}
|
||||||
static _LIBCPP_CONSTEXPR result_type max() {return Max;}
|
static TEST_CONSTEXPR result_type max() {return Max;}
|
||||||
|
|
||||||
explicit rand1(result_type sd = Min) : x_(sd)
|
explicit rand1(result_type sd = Min) : x_(sd)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,6 +19,8 @@
|
|||||||
#include <random>
|
#include <random>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
|
#include "test_macros.h"
|
||||||
|
|
||||||
template <class UIntType, UIntType Min, UIntType Max>
|
template <class UIntType, UIntType Min, UIntType Max>
|
||||||
class rand1
|
class rand1
|
||||||
{
|
{
|
||||||
@@ -32,14 +34,14 @@ private:
|
|||||||
static_assert(Min < Max, "rand1 invalid parameters");
|
static_assert(Min < Max, "rand1 invalid parameters");
|
||||||
public:
|
public:
|
||||||
|
|
||||||
#ifdef _LIBCPP_HAS_NO_CONSTEXPR
|
#if TEST_STD_VER < 11 && defined(_LIBCPP_VERSION)
|
||||||
// Workaround for lack of constexpr in C++03
|
// Workaround for lack of constexpr in C++03
|
||||||
static const result_type _Min = Min;
|
static const result_type _Min = Min;
|
||||||
static const result_type _Max = Max;
|
static const result_type _Max = Max;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static _LIBCPP_CONSTEXPR result_type min() {return Min;}
|
static TEST_CONSTEXPR result_type min() {return Min;}
|
||||||
static _LIBCPP_CONSTEXPR result_type max() {return Max;}
|
static TEST_CONSTEXPR result_type max() {return Max;}
|
||||||
|
|
||||||
explicit rand1(result_type sd = Min) : x_(sd)
|
explicit rand1(result_type sd = Min) : x_(sd)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
#include <random>
|
#include <random>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
#include "test_macros.h"
|
||||||
|
|
||||||
template <class UIntType, UIntType Min, UIntType Max>
|
template <class UIntType, UIntType Min, UIntType Max>
|
||||||
class rand1
|
class rand1
|
||||||
{
|
{
|
||||||
@@ -30,14 +32,14 @@ private:
|
|||||||
static_assert(Min < Max, "rand1 invalid parameters");
|
static_assert(Min < Max, "rand1 invalid parameters");
|
||||||
public:
|
public:
|
||||||
|
|
||||||
#ifdef _LIBCPP_HAS_NO_CONSTEXPR
|
#if TEST_STD_VER < 11 && defined(_LIBCPP_VERSION)
|
||||||
// Workaround for lack of constexpr in C++03
|
// Workaround for lack of constexpr in C++03
|
||||||
static const result_type _Min = Min;
|
static const result_type _Min = Min;
|
||||||
static const result_type _Max = Max;
|
static const result_type _Max = Max;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static _LIBCPP_CONSTEXPR result_type min() {return Min;}
|
static TEST_CONSTEXPR result_type min() {return Min;}
|
||||||
static _LIBCPP_CONSTEXPR result_type max() {return Max;}
|
static TEST_CONSTEXPR result_type max() {return Max;}
|
||||||
|
|
||||||
explicit rand1(result_type sd = Min) : x_(sd)
|
explicit rand1(result_type sd = Min) : x_(sd)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,6 +19,8 @@
|
|||||||
#include <random>
|
#include <random>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
|
#include "test_macros.h"
|
||||||
|
|
||||||
template <class UIntType, UIntType Min, UIntType Max>
|
template <class UIntType, UIntType Min, UIntType Max>
|
||||||
class rand1
|
class rand1
|
||||||
{
|
{
|
||||||
@@ -32,14 +34,14 @@ private:
|
|||||||
static_assert(Min < Max, "rand1 invalid parameters");
|
static_assert(Min < Max, "rand1 invalid parameters");
|
||||||
public:
|
public:
|
||||||
|
|
||||||
#ifdef _LIBCPP_HAS_NO_CONSTEXPR
|
#if TEST_STD_VER < 11 && defined(_LIBCPP_VERSION)
|
||||||
// Workaround for lack of constexpr in C++03
|
// Workaround for lack of constexpr in C++03
|
||||||
static const result_type _Min = Min;
|
static const result_type _Min = Min;
|
||||||
static const result_type _Max = Max;
|
static const result_type _Max = Max;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static _LIBCPP_CONSTEXPR result_type min() {return Min;}
|
static TEST_CONSTEXPR result_type min() {return Min;}
|
||||||
static _LIBCPP_CONSTEXPR result_type max() {return Max;}
|
static TEST_CONSTEXPR result_type max() {return Max;}
|
||||||
|
|
||||||
explicit rand1(result_type sd = Min) : x_(sd)
|
explicit rand1(result_type sd = Min) : x_(sd)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,15 +10,17 @@
|
|||||||
#ifndef REP_H
|
#ifndef REP_H
|
||||||
#define REP_H
|
#define REP_H
|
||||||
|
|
||||||
|
#include "test_macros.h"
|
||||||
|
|
||||||
class Rep
|
class Rep
|
||||||
{
|
{
|
||||||
int data_;
|
int data_;
|
||||||
public:
|
public:
|
||||||
_LIBCPP_CONSTEXPR Rep() : data_(-1) {}
|
TEST_CONSTEXPR Rep() : data_(-1) {}
|
||||||
explicit _LIBCPP_CONSTEXPR Rep(int i) : data_(i) {}
|
explicit TEST_CONSTEXPR Rep(int i) : data_(i) {}
|
||||||
|
|
||||||
bool _LIBCPP_CONSTEXPR operator==(int i) const {return data_ == i;}
|
bool TEST_CONSTEXPR operator==(int i) const {return data_ == i;}
|
||||||
bool _LIBCPP_CONSTEXPR operator==(const Rep& r) const {return data_ == r.data_;}
|
bool TEST_CONSTEXPR operator==(const Rep& r) const {return data_ == r.data_;}
|
||||||
|
|
||||||
Rep& operator*=(Rep x) {data_ *= x.data_; return *this;}
|
Rep& operator*=(Rep x) {data_ *= x.data_; return *this;}
|
||||||
Rep& operator/=(Rep x) {data_ /= x.data_; return *this;}
|
Rep& operator/=(Rep x) {data_ /= x.data_; return *this;}
|
||||||
|
|||||||
Reference in New Issue
Block a user