From 941d72d8df92a4b07296d8c35bd63d3fb0b61fe7 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 13 Dec 2002 11:14:29 +0000 Subject: [PATCH] Initial commit [SVN r16601] --- test/boost_no_ret_det.ipp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 test/boost_no_ret_det.ipp diff --git a/test/boost_no_ret_det.ipp b/test/boost_no_ret_det.ipp new file mode 100644 index 00000000..c5e89a06 --- /dev/null +++ b/test/boost_no_ret_det.ipp @@ -0,0 +1,33 @@ +// (C) Copyright John Maddock 2001. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// MACRO: BOOST_NO_UNREACHABLE_RETURN_DETECTION +// TITLE: detection of unreachable returns +// DESCRIPTION: If a return is unreachable, then no return +// statement should be required, however some +// compilers insist on it, while other issue a +// bunch of warnings if it is in fact present. + + +namespace boost_no_unreachable_return_detection{ + +int checker() +{ + throw 0; + // no return statement: we don't ever get here... +} + +int check = 0; + +int test() +{ + if(check) + return checker(); + return 0; +} + +} + +