Debian Codegraph @

cmake/cxx_tests/new_for_scoping.cpp

raw
1 // DESCRIPTION
2 //
3 // Test to check whether the compiler accepts the new for scoping rules (the scope of a
4 // variable declared inside the parentheses is restricted to the for-body),
5 // define HAVE_NEW_FOR_SCOPING.
6 // In sync with AC_CXX_NEW_FOR_SCOPING (2008-04-12).
7 //
8 // COPYLEFT
9 //
10 // Copyright (c) 2008 Todd Veldhuizen
11 // Copyright (c) 2009 Theo Papadopoulo <[email protected]>
12 // Copyright (c) 2008 Luc Maisonobe <[email protected]>
13 //
14 // Copying and distribution of this file, with or without modification, are
15 // permitted in any medium without royalty provided the copyright notice
16 // and this notice are preserved.
17
18 int main() {
19 int z = 0;
20 for (int i = 0; i < 10; ++i)
21 z = z + i;
22 for (int i = 0; i < 10; ++i)
23 z = z - i;
24 return z;
25 }