Emit line directives for includes with directive on first line #223
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Attempts to address #222
Include files that begin with an
#if
/#ifdef
/#define
directive now properly emit the line directive that was previously missing.Because the test suite is using the
eat_whitespace
context policy, the issue only shows if the directive in the include file occurs on the very first line of the file (hence why the copyright comments have been moved to the end of the test files). If thedefault_preprocessing_hooks
was used, the copyright comment could be at the beginning and still show the issue.From my debugging, it seems like the line directive was failing to be emitted because it would errantly fall into this portion of the if-block in cpp_iterator: https://github.com/boostorg/wave/blob/develop/include/boost/wave/util/cpp_iterator.hpp#L786
Here's the output for the
t_2_032.cpp
test that I added prior to the change:And here's the output after this change: