From 11be1f5a93e747d865874996a92245a70225c609 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 14 May 2005 18:44:59 +0000 Subject: [PATCH] Add static_assert test to test use inside template functions. Currently this test fails on CW-8.x compilers. [SVN r28904] --- Jamfile | 1 + static_assert_test_fail_function.cpp | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 static_assert_test_fail_function.cpp diff --git a/Jamfile b/Jamfile index 53a69de..a677de0 100644 --- a/Jamfile +++ b/Jamfile @@ -17,6 +17,7 @@ test-suite static_assert : [ compile-fail static_assert_test_fail_6.cpp ] [ compile-fail static_assert_test_fail_7.cpp ] [ compile-fail static_assert_test_fail_8.cpp ] + [ compile-fail static_assert_test_fail_function.cpp ] ; diff --git a/static_assert_test_fail_function.cpp b/static_assert_test_fail_function.cpp new file mode 100644 index 0000000..ddc2d1a --- /dev/null +++ b/static_assert_test_fail_function.cpp @@ -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 + +template +int foo() +{ + BOOST_STATIC_ASSERT( N < 2 ); + + return N; +} + +int main() +{ + return foo<5>(); +}