Skip to content

Correct #line directive to cpp2 source file #57

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

Closed

Conversation

filipsajdak
Copy link
Contributor

Closes #56

After introducing output option the #line directives points to the output file path instead of cpp2 source path.

Cpp2 source file

i : int = 42;

Steps

1. build/external/cppfront external/tests/easy.cpp2 -o build/easy.cpp

build/easy.cpp content

// ----- Cpp2 support -----
#include "cpp2util.h"


#line 1 "build/easy.cpp2"

//=== Cpp2 definitions ==========================================================

#line 1 "build/easy.cpp2"
    int i { 42 }; 

Error & expected behaviour

#line directive points to file build/easy.cpp2 that does not exists. The expected path is external/tests/easy.cpp2

@hsutter hsutter self-assigned this Oct 9, 2022
@hsutter hsutter closed this in e0df1ee Oct 9, 2022
@hsutter
Copy link
Owner

hsutter commented Oct 9, 2022

Thanks! I saw this issue via email and did the fix, then noticed this was a PR and your fix was essentially identical to what I did. :) But please check, thanks.

Azmah-Bad pushed a commit to Azmah-Bad/cppfront that referenced this pull request Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Correct #line directives to point to cpp2 source when output option is used
2 participants