• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*=============================================================================
2     Boost.Wave: A Standard compliant C++ preprocessor library
3     http://www.boost.org/
4 
5     Copyright (c) 2020 Jeff Trull. Distributed under the Boost
6     Software License, Version 1.0. (See accompanying file
7     LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 =============================================================================*/
9 
10 //O --c++17
11 //O -Werror
12 
13 // Test __has_include() returning false
14 
15 #ifdef __has_include
16 #if __has_include("some_include_file.h")
17 #warning found header, but should not have
18 #elif __has_include("some_include_file.h")
19 #warning found header, but should not have : elif
20 #else
21 #define NOTFOUND_AS_EXPECTED
22 #endif
23 #else
24 #warning has_include does not seem to be working
25 #endif
26 
27 //H 10: t_2_023.cpp(15): #ifdef
28 //H 11: t_2_023.cpp(15): #ifdef __has_include: 1
29 //H 10: t_2_023.cpp(16): #if
30 //H 11: t_2_023.cpp(16): #if __has_include("some_include_file.h"): 0
31 //H 10: t_2_023.cpp(18): #elif
32 //H 11: t_2_023.cpp(18): #elif __has_include("some_include_file.h"): 0
33 //H 10: t_2_023.cpp(21): #define
34 //H 08: t_2_023.cpp(21): NOTFOUND_AS_EXPECTED=
35 //H 10: t_2_023.cpp(22): #endif
36 //H 10: t_2_023.cpp(23): #else
37 
38 #ifndef __has_include
39 #warning has_include appears to be disabled
40 #else
41 #define HAS_INCLUDE_WORKS_IFNDEF
42 #if __has_include("t_2_023.cpp")
43 #define HAS_INCLUDE_WORKS_FILECHECK
44 #endif
45 #if !__has_include("t_2_023.cpp")
46 #warning has_include cannot find the file it is in
47 #elif __has_include("t_2_023.cpp")
48 #define HAS_INCLUDE_ELIF_FILECHECK
49 #else
50 #warning has_include cannot find the file it is in - elif
51 #endif
52 #endif
53 
54 //H 10: t_2_023.cpp(38): #ifndef
55 //H 11: t_2_023.cpp(38): #ifndef __has_include: 1
56 //H 10: t_2_023.cpp(41): #define
57 //H 08: t_2_023.cpp(41): HAS_INCLUDE_WORKS_IFNDEF=
58 //H 10: t_2_023.cpp(42): #if
59 //H 11: t_2_023.cpp(42): #if __has_include("t_2_023.cpp"): 1
60 //H 10: t_2_023.cpp(43): #define
61 //H 08: t_2_023.cpp(43): HAS_INCLUDE_WORKS_FILECHECK=
62 //H 10: t_2_023.cpp(44): #endif
63 //H 10: t_2_023.cpp(45): #if
64 //H 11: t_2_023.cpp(45): #if !__has_include("t_2_023.cpp"): 0
65 //H 10: t_2_023.cpp(47): #elif
66 //H 11: t_2_023.cpp(47): #elif __has_include("t_2_023.cpp"): 1
67 //H 10: t_2_023.cpp(48): #define
68 //H 08: t_2_023.cpp(48): HAS_INCLUDE_ELIF_FILECHECK=
69 //H 10: t_2_023.cpp(49): #else
70 //H 10: t_2_023.cpp(52): #endif
71 
72 
73