-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix pure cpp1 header file generated using -import-std #1319
base: main
Are you sure you want to change the base?
Fix pure cpp1 header file generated using -import-std #1319
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
31e6312
to
df266a6
Compare
Unless you specify the flag to either import or include the standard library, then it adds extra stuff. Lines 1298 to 1305 in 68b716a
|
source/to_cpp1.h
Outdated
@@ -1497,6 +1497,13 @@ class cppfront | |||
// | |||
if (!source.has_cpp2()) { | |||
assert(ret.cpp2_lines == 0); | |||
if ( | |||
cpp1_filename.back() == 'h' | |||
&& flag_import_std |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(flag_import_std || flag_include_std)
to match
Lines 1301 to 1305 in 68b716a
if ( | |
source.has_cpp2() | |
|| flag_import_std | |
|| flag_include_std | |
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I force-pushed with your suggestion. Thanks 😊
df266a6
to
ed1fa67
Compare
Thanks for your pull request! It looks like this may be your first contribution to cppfront. I've emailed you the Contributor License Agreement (CLA), and once it's completed I can look at your pull request. Thanks again for your contribution. |
I've noticed that if I execute
cppfront.exe
with the-import-std
option on a .h file that doesn't contain any cpp2 code, then an#endif
will be missing at the end of the file. See #1320 for more info.