Fix some warnings and miswritten test case, add test for BOOST_HAS_PRAGMA_DETECT_MISMATCH.

This commit is contained in:
jzmaddock
2018-04-18 20:08:22 +01:00
parent f3ebdc4558
commit 39f48141c5
13 changed files with 130 additions and 8 deletions

View File

@ -1,6 +1,6 @@
#
# *** DO NOT EDIT THIS FILE BY HAND ***
# This file was automatically generated on Tue Mar 6 17:44:35 2018
# This file was automatically generated on Wed Apr 18 20:03:40 2018
# by libs/config/tools/generate.cpp
# Copyright John Maddock.
# Use, modification and distribution are subject to the
@ -14,6 +14,7 @@ import path ;
obj two_arg_use_facet : test_case.cpp : <define>TEST_BOOST_HAS_TWO_ARG_USE_FACET ;
obj bethreads : test_case.cpp : <define>TEST_BOOST_HAS_BETHREADS ;
obj clock_gettime : test_case.cpp : <define>TEST_BOOST_HAS_CLOCK_GETTIME ;
obj pragma_detect_mismatch : test_case.cpp : <define>TEST_BOOST_HAS_PRAGMA_DETECT_MISMATCH ;
obj dirent_h : test_case.cpp : <define>TEST_BOOST_HAS_DIRENT_H ;
obj expm1 : test_case.cpp : <define>TEST_BOOST_HAS_EXPM1 ;
obj float128 : test_case.cpp : <define>TEST_BOOST_HAS_FLOAT128 ;

View File

@ -1,4 +1,4 @@
// This file was automatically generated on Tue Mar 6 17:44:35 2018
// This file was automatically generated on Wed Apr 18 20:03:40 2018
// by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to the
@ -26,6 +26,11 @@
# error "Feature macro BOOST_HAS_CLOCK_GETTIME is not defined."
# endif
#endif
#ifdef TEST_BOOST_HAS_PRAGMA_DETECT_MISMATCH
# ifndef BOOST_HAS_PRAGMA_DETECT_MISMATCH
# error "Feature macro BOOST_HAS_PRAGMA_DETECT_MISMATCH is not defined."
# endif
#endif
#ifdef TEST_BOOST_HAS_DIRENT_H
# ifndef BOOST_HAS_DIRENT_H
# error "Feature macro BOOST_HAS_DIRENT_H is not defined."

View File

@ -1,7 +1,7 @@
#
# Regression test Jamfile for boost configuration setup.
# *** DO NOT EDIT THIS FILE BY HAND ***
# This file was automatically generated on Tue Mar 6 17:44:35 2018
# This file was automatically generated on Wed Apr 18 20:03:40 2018
# by libs/config/tools/generate.cpp
# Copyright John Maddock.
# Use, modification and distribution are subject to the
@ -31,6 +31,9 @@ test-suite "BOOST_HAS_BETHREADS" :
test-suite "BOOST_HAS_CLOCK_GETTIME" :
[ run ../has_clock_gettime_pass.cpp ]
[ compile-fail ../has_clock_gettime_fail.cpp ] ;
test-suite "BOOST_HAS_PRAGMA_DETECT_MISMATCH" :
[ run ../has_detect_mismatch_pass.cpp ]
[ compile-fail ../has_detect_mismatch_fail.cpp ] ;
test-suite "BOOST_HAS_DIRENT_H" :
[ run ../has_dirent_h_pass.cpp ]
[ compile-fail ../has_dirent_h_fail.cpp ] ;

View File

@ -0,0 +1,24 @@
// (C) Copyright John Maddock 2018.
// 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 most recent version.
// MACRO: BOOST_HAS_PRAGMA_DETECT_MISMATCH
// TITLE: detect_mismatch pragma
// DESCRIPTION: The compiler supports #pragma detect_mismatch
#include <cstdlib>
namespace boost_has_pragma_detect_mismatch {
int test()
{
# pragma detect_mismatch("Boost_Config", "1")
return 0;
}
}

View File

@ -25,7 +25,7 @@ namespace boost_has_partial_std_allocator{
//
template <class T>
int test_allocator(const T& i)
int test_allocator(const T&)
{
typedef std::allocator<int> alloc1_t;
#if !((__cplusplus > 201700) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201700)))

View File

@ -52,6 +52,8 @@ int test()
a1 |= 2;
a1 ^= 3;
a2 = 0u;
a3.store(&v);
a3.fetch_add(1);
a3.fetch_sub(1);

View File

@ -17,6 +17,7 @@ namespace boost_no_cxx11_hdr_tuple {
int test()
{
std::tuple<int, int, long> t(0, 1, 2);
(void)t;
return 0;
}

View File

@ -18,7 +18,7 @@ namespace boost_no_cxx11_pointer_traits {
template<class T>
struct pointer {
template<class U>
using rebind = pointer<bool>;
using rebind = pointer<U>;
};
template<class T>
@ -31,7 +31,7 @@ struct result<pointer<bool> > {
int test()
{
return result<std::pointer_traits<pointer<int> >::rebind<char> >::value;
return result<std::pointer_traits<pointer<int> >::rebind<bool> >::value;
}
} /* boost_no_cxx11_pointer_traits */

View File

@ -25,7 +25,7 @@ namespace boost_no_std_allocator{
#endif
template <class T>
int test_allocator(const T& i)
int test_allocator(const T&)
{
typedef std::allocator<int> alloc1_t;
#if !((__cplusplus > 201700) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201700)))

View File

@ -1054,6 +1054,7 @@ void print_boost_macros()
PRINT_MACRO(BOOST_HAS_NL_TYPES_H);
PRINT_MACRO(BOOST_HAS_NRVO);
PRINT_MACRO(BOOST_HAS_PARTIAL_STD_ALLOCATOR);
PRINT_MACRO(BOOST_HAS_PRAGMA_DETECT_MISMATCH);
PRINT_MACRO(BOOST_HAS_PTHREADS);
PRINT_MACRO(BOOST_HAS_PTHREAD_DELAY_NP);
PRINT_MACRO(BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE);
@ -1235,6 +1236,7 @@ void print_boost_macros()
// END GENERATED BLOCK
PRINT_MACRO(BOOST_INTEL);

View File

@ -1,4 +1,4 @@
// This file was automatically generated on Tue Mar 6 17:44:35 2018
// This file was automatically generated on Wed Apr 18 20:03:40 2018
// by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to the
@ -823,6 +823,11 @@ namespace boost_has_bethreads = empty_boost;
#else
namespace boost_has_clock_gettime = empty_boost;
#endif
#ifdef BOOST_HAS_PRAGMA_DETECT_MISMATCH
#include "boost_has_detect_mismatch.ipp"
#else
namespace boost_has_pragma_detect_mismatch = empty_boost;
#endif
#ifdef BOOST_HAS_DIRENT_H
#include "boost_has_dirent_h.ipp"
#else
@ -1006,6 +1011,11 @@ int main( int, char *[] )
std::cerr << "Failed test for BOOST_HAS_CLOCK_GETTIME at: " << __FILE__ << ":" << __LINE__ << std::endl;
++error_count;
}
if(0 != boost_has_pragma_detect_mismatch::test())
{
std::cerr << "Failed test for BOOST_HAS_PRAGMA_DETECT_MISMATCH at: " << __FILE__ << ":" << __LINE__ << std::endl;
++error_count;
}
if(0 != boost_has_dirent_h::test())
{
std::cerr << "Failed test for BOOST_HAS_DIRENT_H at: " << __FILE__ << ":" << __LINE__ << std::endl;

View File

@ -0,0 +1,37 @@
// This file was automatically generated on Wed Apr 18 20:03:40 2018
// 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$
//
// Test file for macro BOOST_HAS_PRAGMA_DETECT_MISMATCH
// This file should not compile, if it does then
// BOOST_HAS_PRAGMA_DETECT_MISMATCH should be defined.
// See file boost_has_detect_mismatch.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_HAS_PRAGMA_DETECT_MISMATCH
#include "boost_has_detect_mismatch.ipp"
#else
#error "this file should not compile"
#endif
int main( int, char *[] )
{
return boost_has_pragma_detect_mismatch::test();
}

View File

@ -0,0 +1,37 @@
// This file was automatically generated on Wed Apr 18 20:03:40 2018
// 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$
//
// Test file for macro BOOST_HAS_PRAGMA_DETECT_MISMATCH
// This file should compile, if it does not then
// BOOST_HAS_PRAGMA_DETECT_MISMATCH should not be defined.
// See file boost_has_detect_mismatch.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_HAS_PRAGMA_DETECT_MISMATCH
#include "boost_has_detect_mismatch.ipp"
#else
namespace boost_has_pragma_detect_mismatch = empty_boost;
#endif
int main( int, char *[] )
{
return boost_has_pragma_detect_mismatch::test();
}