forked from OSchip/llvm-project
Fix or disable C++11 tests in C++03 mode
llvm-svn: 245531
This commit is contained in:
parent
be78c25acb
commit
c79a8f7753
|
@ -7,6 +7,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
#include <exception>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
|
|
|
@ -7,17 +7,13 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
|
||||
#ifndef __has_feature
|
||||
#define __has_feature(x) 0
|
||||
#endif
|
||||
|
||||
struct A {};
|
||||
|
||||
#if __has_feature(cxx_nullptr)
|
||||
|
||||
void test1()
|
||||
{
|
||||
try
|
||||
|
@ -62,22 +58,6 @@ void catch_nullptr_test() {
|
|||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void test1()
|
||||
{
|
||||
}
|
||||
|
||||
void test2()
|
||||
{
|
||||
}
|
||||
|
||||
template <class Catch>
|
||||
void catch_nullptr_test()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
|
|
|
@ -9,6 +9,10 @@
|
|||
|
||||
#include <cassert>
|
||||
|
||||
#if __cplusplus < 201103L
|
||||
#define DISABLE_NULLPTR_TESTS
|
||||
#endif
|
||||
|
||||
struct A {};
|
||||
A a;
|
||||
const A ca = A();
|
||||
|
@ -99,6 +103,7 @@ void test5 ()
|
|||
|
||||
void test6 ()
|
||||
{
|
||||
#if !defined(DISABLE_NULLPTR_TESTS)
|
||||
try
|
||||
{
|
||||
throw nullptr;
|
||||
|
@ -111,6 +116,7 @@ void test6 ()
|
|||
{
|
||||
assert (false);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void test7 ()
|
||||
|
@ -152,6 +158,7 @@ void test8 ()
|
|||
|
||||
void test9 ()
|
||||
{
|
||||
#if !defined(DISABLE_NULLPTR_TESTS)
|
||||
try
|
||||
{
|
||||
throw nullptr;
|
||||
|
@ -164,6 +171,7 @@ void test9 ()
|
|||
{
|
||||
assert (false);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void test10 ()
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
#include <cassert>
|
||||
#include <tuple>
|
||||
#include "support/timer.hpp"
|
||||
|
|
Loading…
Reference in New Issue