Debian Codegraph @

cmake/cxx_tests/bool.cpp

raw
1 // DESCRIPTION
2 //
3 // Test to check whether the C++ compiler recognizes bool as a separate built-in type.
4 // Note that a typedef is not a separate type since you cannot overload a function such
5 // that it accepts either the basic type or the typedef.
6 // In sync with AC_CXX_BOOL (2008-04-12).
7 //
8 // COPYLEFT
9 //
10 // Copyright (c) 2009 Theo Papadopoulo <[email protected]>
11 // Copyright (c) 2008 Todd Veldhuizen
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 f(int x) { return 1; }
19 int f(char x) { return 1; }
20 int f(bool x) { return 1; }
21
22 int main() {
23 bool b = true;
24 return f(b);
25 }