Merge config doc and test updates.

[SVN r84462]
This commit is contained in:
John Maddock committed 2013-05-24 17:07:06 +00:00
1 parent 5925c5a12e
commit d8973bac08
11 files changed
+2249 -1992

No files matched your search

+1
View File
@@ -65,4 +65,5 @@ test-suite config
]
[ compile-fail threads/test_thread_fail1.cpp ]
[ compile-fail threads/test_thread_fail2.cpp ]
[ compile boost_fallthrough_test.cpp : <toolset>clang:<cxxflags>"-std=c++11 -Wimplicit-fallthrough" <warnings-as-errors>on <warnings>all ]
;
+490 -487
View File
File diff suppressed because it is too large. Load diff
+20
View File
@@ -0,0 +1,20 @@
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/config.hpp>
int test(int n)
{
switch (n)
{
case 0:
n++;
BOOST_FALLTHROUGH;
case 1:
n++;
break;
}
return n;
}
+67
View File
@@ -0,0 +1,67 @@
// (C) Copyright John Maddock 2013
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/config for more information.
// MACRO: BOOST_NO_CXX11_USER_DEFINED_LITERALS
// TITLE: C++11 user defined literals.
// DESCRIPTION: The compiler does not support the C++11 literals including user-defined suffixes.
#include <memory>
namespace boost_no_cxx11_user_defined_literals {
struct my_literal
{
constexpr my_literal() : val(0) {}
constexpr my_literal(int i) : val(i) {}
constexpr my_literal(const my_literal& a) : val(a.val) {}
constexpr bool operator==(const my_literal& a) { return val == a.val; }
int val;
};
template <unsigned base, unsigned long long val, char... Digits>
struct parse_int
{
// The default specialization is also the termination condition:
// it gets invoked only when sizeof...Digits == 0.
static_assert(base<=16u,"only support up to hexadecimal");
static constexpr unsigned long long value{ val };
};
template <unsigned base, unsigned long long val, char c, char... Digits>
struct parse_int<base, val, c, Digits...>
{
static constexpr unsigned long long char_value = (c >= '0' && c <= '9')
? c - '0'
: (c >= 'a' && c <= 'f')
? c - 'a'
: (c >= 'A' && c <= 'F')
? c - 'A'
: 400u;
static_assert(char_value < base, "Encountered a digit out of range");
static constexpr unsigned long long value{ parse_int<base, val * base +
char_value, Digits...>::value };
};
constexpr my_literal operator "" _suf1(unsigned long long v)
{
return my_literal(v);
}
template <char...PACK>
constexpr my_literal operator "" _bin()
{
return parse_int<2, 0, PACK...>::value;
}
int test()
{
constexpr my_literal a = 0x23_suf1;
constexpr my_literal b = 1001_bin;
return ((a == my_literal(0x23)) && (b == my_literal(9))) ? 0 : 1;
}
}
+4 -19
View File
@@ -563,6 +563,8 @@ void print_stdlib_macros()
PRINT_MACRO(_HAS_EXCEPTIONS);
PRINT_MACRO(_HAS_MEMBER_TEMPLATES_REBIND);
PRINT_MACRO(_HAS_TEMPLATE_PARTIAL_ORDERING);
// Libc++:
PRINT_MACRO(_LIBCPP_VERSION);
// STLPort and generic SGI STL options:
PRINT_MACRO(__SGI_STL_NO_ARROW_OPERATOR);
PRINT_MACRO(__SGI_STL_OWN_IOSTREAMS);
@@ -1037,6 +1039,7 @@ void print_boost_macros()
PRINT_MACRO(BOOST_NO_CXX11_TEMPLATE_ALIASES);
PRINT_MACRO(BOOST_NO_CXX11_UNICODE_LITERALS);
PRINT_MACRO(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX);
PRINT_MACRO(BOOST_NO_CXX11_USER_DEFINED_LITERALS);
PRINT_MACRO(BOOST_NO_CXX11_VARIADIC_MACROS);
PRINT_MACRO(BOOST_NO_CXX11_VARIADIC_TEMPLATES);
PRINT_MACRO(BOOST_NO_DEPENDENT_NESTED_DERIVATIONS);
@@ -1098,25 +1101,6 @@ void print_boost_macros()
PRINT_MACRO(BOOST_NO_USING_TEMPLATE);
PRINT_MACRO(BOOST_NO_VOID_RETURNS);
// END GENERATED BLOCK
@@ -1130,6 +1114,7 @@ void print_boost_macros()
PRINT_MACRO(BOOST_STATIC_CONSTEXPR);
PRINT_MACRO(BOOST_NOEXCEPT);
PRINT_MACRO(BOOST_FORCEINLINE);
PRINT_MACRO(BOOST_FALLTHROUGH);
}
void print_separator()
+1495 -1485
View File
File diff suppressed because it is too large. Load diff
+37
View File
@@ -0,0 +1,37 @@
// This file was automatically generated on Sun Apr 28 18:36:48 2013
// by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/config for the most recent version.//
// Revision $Id: generate.cpp 72327 2011-06-01 14:51:03Z eric_niebler $
//
// Test file for macro BOOST_NO_CXX11_USER_DEFINED_LITERALS
// This file should not compile, if it does then
// BOOST_NO_CXX11_USER_DEFINED_LITERALS should not be defined.
// See file boost_no_cxx11_user_lit.ipp for details
// Must not have BOOST_ASSERT_CONFIG set; it defeats
// the objective of this file:
#ifdef BOOST_ASSERT_CONFIG
# undef BOOST_ASSERT_CONFIG
#endif
#include <boost/config.hpp>
#include "test.hpp"
#ifdef BOOST_NO_CXX11_USER_DEFINED_LITERALS
#include "boost_no_cxx11_user_lit.ipp"
#else
#error "this file should not compile"
#endif
int main( int, char *[] )
{
return boost_no_cxx11_user_defined_literals::test();
}
+37
View File
@@ -0,0 +1,37 @@
// This file was automatically generated on Sun Apr 28 18:36:48 2013
// by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/config for the most recent version.//
// Revision $Id: generate.cpp 72327 2011-06-01 14:51:03Z eric_niebler $
//
// Test file for macro BOOST_NO_CXX11_USER_DEFINED_LITERALS
// This file should compile, if it does not then
// BOOST_NO_CXX11_USER_DEFINED_LITERALS should be defined.
// See file boost_no_cxx11_user_lit.ipp for details
// Must not have BOOST_ASSERT_CONFIG set; it defeats
// the objective of this file:
#ifdef BOOST_ASSERT_CONFIG
# undef BOOST_ASSERT_CONFIG
#endif
#include <boost/config.hpp>
#include "test.hpp"
#ifndef BOOST_NO_CXX11_USER_DEFINED_LITERALS
#include "boost_no_cxx11_user_lit.ipp"
#else
namespace boost_no_cxx11_user_defined_literals = empty_boost;
#endif
int main( int, char *[] )
{
return boost_no_cxx11_user_defined_literals::test();
}