mirror of
https://github.com/boostorg/static_assert.git
synced 2025-07-31 13:17:21 +02:00
Add static_assert test to test use inside template functions. Currently this test fails on CW-8.x compilers.
[SVN r28904]
This commit is contained in:
1
Jamfile
1
Jamfile
@ -17,6 +17,7 @@ test-suite static_assert :
|
|||||||
[ compile-fail static_assert_test_fail_6.cpp ]
|
[ compile-fail static_assert_test_fail_6.cpp ]
|
||||||
[ compile-fail static_assert_test_fail_7.cpp ]
|
[ compile-fail static_assert_test_fail_7.cpp ]
|
||||||
[ compile-fail static_assert_test_fail_8.cpp ]
|
[ compile-fail static_assert_test_fail_8.cpp ]
|
||||||
|
[ compile-fail static_assert_test_fail_function.cpp ]
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
18
static_assert_test_fail_function.cpp
Normal file
18
static_assert_test_fail_function.cpp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
//~ Copyright 2005 Redshift Software, Inc.
|
||||||
|
//~ Distributed under the Boost Software License, Version 1.0.
|
||||||
|
//~ (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
#include <boost/static_assert.hpp>
|
||||||
|
|
||||||
|
template <int N>
|
||||||
|
int foo()
|
||||||
|
{
|
||||||
|
BOOST_STATIC_ASSERT( N < 2 );
|
||||||
|
|
||||||
|
return N;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
return foo<5>();
|
||||||
|
}
|
Reference in New Issue
Block a user