1
2// Copyright (C) 2009-2012 Lorenzo Caminiti
3// Distributed under the Boost Software License, Version 1.0
4// (see accompanying file LICENSE_1_0.txt or a copy at
5// http://www.boost.org/LICENSE_1_0.txt)
6// Home at http://www.boost.org/libs/local_function
7
8#include <boost/local_function.hpp>
9
10int error(int x, int y) {
11 int BOOST_LOCAL_FUNCTION( (int z) ) {
12 if(z <= 0) goto failure;
13 else goto success;
14 success:
15 return 0;
16 } BOOST_LOCAL_FUNCTION_NAME(validate)
17
18 return validate(x + y);
19failure:
20 return -1;
21}
22
23int main(void) {
24 error(x: 1, y: 2);
25 return 0;
26}
27
28

source code of boost/libs/local_function/test/goto_error_seq.cpp