-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Emit line directives for includes with directive on first line (#223)
* Emit line directives for includes with directive on first line * Add nested include tests Thanks to Nick Nobles for this bug report and fix
- Loading branch information
Showing
8 changed files
with
161 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/*============================================================================= | ||
Boost.Wave: A Standard compliant C++ preprocessor library | ||
http://www.boost.org/ | ||
Copyright (c) 2024 Nick Nobles. Distributed under the Boost | ||
Software License, Version 1.0. (See accompanying file | ||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
=============================================================================*/ | ||
|
||
// Line directives should be emitted for included files when they begin | ||
// with a single #if/#ifdef/#define directive. Addresses github issue #222. | ||
#include "t_5_040_001.hpp" // #if as first line should emit line directive | ||
#include "t_5_040_002.hpp" // #define as first line should emit line directive | ||
#include "t_5_040_003.hpp" // ensure nested includes emit line directive | ||
#include "t_5_040_005.hpp" // ensure empty initial lines produce line directive | ||
|
||
t_5_040_a | ||
#if 1 | ||
t_5_040_b | ||
#endif | ||
|
||
//R #line 2 "t_5_040_001.hpp" | ||
//R t_5_040_001a | ||
//R #line 6 "t_5_040_001.hpp" | ||
//R t_5_040_001b | ||
//R | ||
//R t_5_040_001c | ||
//R #line 2 "t_5_040_002.hpp" | ||
//R t_5_040_002 | ||
//R #line 2 "t_5_040_004.hpp" | ||
//R t_5_040_004 | ||
//R #line 2 "t_5_040_003.hpp" | ||
//R t_5_040_003 | ||
//R #line 15 "t_5_040_005.hpp" | ||
//R t_5_040_005 | ||
//R #line 17 "t_5_040.cpp" | ||
//R t_5_040_a | ||
//R | ||
//R t_5_040_b | ||
|
||
//H 10: t_5_040.cpp(12): #include "t_5_040_001.hpp" | ||
//H 04: "t_5_040_001.hpp" | ||
//H 05: $S(t_5_040_001.hpp) ($B(t_5_040_001.hpp)) | ||
//H 10: t_5_040_001.hpp(1): #if | ||
//H 11: t_5_040_001.hpp(1): #if 1: 1 | ||
//H 10: t_5_040_001.hpp(3): #endif | ||
//H 10: t_5_040_001.hpp(7): #if | ||
//H 11: t_5_040_001.hpp(7): #if 1: 1 | ||
//H 10: t_5_040_001.hpp(9): #endif | ||
//H 06: | ||
//H 10: t_5_040.cpp(13): #include "t_5_040_002.hpp" | ||
//H 04: "t_5_040_002.hpp" | ||
//H 05: t_5_040_002.hpp ($B(t_5_040_002.hpp)) | ||
//H 10: t_5_040_002.hpp(1): #define | ||
//H 08: t_5_040_002.hpp(1): t_5_040_002_hpp= | ||
//H 06: | ||
//H 10: t_5_040.cpp(14): #include "t_5_040_003.hpp" | ||
//H 04: "t_5_040_003.hpp" | ||
//H 05: t_5_040_003.hpp ($B(t_5_040_003.hpp)) | ||
//H 10: t_5_040_003.hpp(1): #include "t_5_040_004.hpp" | ||
//H 04: "t_5_040_004.hpp" | ||
//H 05: t_5_040_004.hpp ($B(t_5_040_004.hpp)) | ||
//H 10: t_5_040_004.hpp(1): #if | ||
//H 11: t_5_040_004.hpp(1): #if 1: 1 | ||
//H 10: t_5_040_004.hpp(3): #endif | ||
//H 06: | ||
//H 06: | ||
//H 10: t_5_040.cpp(15): #include "t_5_040_005.hpp" | ||
//H 04: "t_5_040_005.hpp" | ||
//H 05: t_5_040_005.hpp ($B(t_5_040_005.hpp)) | ||
//H 06: | ||
//H 10: t_5_040.cpp(18): #if | ||
//H 11: t_5_040.cpp(18): #if 1: 1 | ||
//H 10: t_5_040.cpp(20): #endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#if 1 | ||
t_5_040_001a | ||
#endif | ||
|
||
//Ensure line directive still properly gets replaced with empty line | ||
t_5_040_001b | ||
#if 1 | ||
t_5_040_001c | ||
#endif | ||
|
||
// Important: The #if must be the first line of this file to ensure proper testing | ||
// of line directive emission. Do not move the copyright comment to the | ||
// beginning of this file. | ||
|
||
/*============================================================================= | ||
Boost.Wave: A Standard compliant C++ preprocessor library | ||
http://www.boost.org/ | ||
Copyright (c) 2024 Nick Nobles. Distributed under the Boost | ||
Software License, Version 1.0. (See accompanying file | ||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
=============================================================================*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#define t_5_040_002_hpp | ||
t_5_040_002 | ||
|
||
// Important: The #define must be the first line of this file to ensure proper testing | ||
// of line directive emission. Do not move the copyright comment to the | ||
// beginning of this file. | ||
|
||
/*============================================================================= | ||
Boost.Wave: A Standard compliant C++ preprocessor library | ||
http://www.boost.org/ | ||
Copyright (c) 2024 Nick Nobles. Distributed under the Boost | ||
Software License, Version 1.0. (See accompanying file | ||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
=============================================================================*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include "t_5_040_004.hpp" | ||
t_5_040_003 | ||
|
||
// Important: The #include must be the first line of this file to ensure proper testing | ||
// of line directive emission. Do not move the copyright comment to the | ||
// beginning of this file. | ||
|
||
/*============================================================================= | ||
Boost.Wave: A Standard compliant C++ preprocessor library | ||
http://www.boost.org/ | ||
Copyright (c) 2024 Nick Nobles. Distributed under the Boost | ||
Software License, Version 1.0. (See accompanying file | ||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
=============================================================================*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#if 1 | ||
t_5_040_004 | ||
#endif | ||
|
||
// Important: The #if must be the first line of this file to ensure proper testing | ||
// of line directive emission. Do not move the copyright comment to the | ||
// beginning of this file. | ||
|
||
/*============================================================================= | ||
Boost.Wave: A Standard compliant C++ preprocessor library | ||
http://www.boost.org/ | ||
Copyright (c) 2024 Nick Nobles. Distributed under the Boost | ||
Software License, Version 1.0. (See accompanying file | ||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
=============================================================================*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
// Important: The first line of this file must be blank to ensure proper testing | ||
// of line directive emission. Do not move the copyright comment to the | ||
// beginning of this file. | ||
|
||
/*============================================================================= | ||
Boost.Wave: A Standard compliant C++ preprocessor library | ||
http://www.boost.org/ | ||
Copyright (c) 2024 Jeff Trull. Distributed under the Boost | ||
Software License, Version 1.0. (See accompanying file | ||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
=============================================================================*/ | ||
|
||
t_5_040_005 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters