Skip to content
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

parser_tree.cpp example not compiling in VS 2022, as of PEGTL 3.2.6 #333

Open
sephirot47 opened this issue Jan 28, 2023 · 4 comments
Open
Assignees

Comments

@sephirot47
Copy link

sephirot47 commented Jan 28, 2023

It complains about PEGTL\include\tao\pegtl\match.hpp(77,16): error C2065: 'type': undeclared identifier.
I think it has something to do with the unwind change introduced in PEGTL 3.2.6, but no idea. Working in PEGTL 3.2.5

@sephirot47 sephirot47 changed the title parser_tree.cpp example not compiling in VS 2022, as of PEGTL 2.6 parser_tree.cpp example not compiling in VS 2022, as of PEGTL 2.3.6 Jan 28, 2023
@d-frey
Copy link
Member

d-frey commented Jan 29, 2023

Do you mean version 3.2.6 instead of 2.3.6?

Also, we have CI jobs for VS 2022 which are passing. See https://github.com/taocpp/PEGTL/actions/runs/3950723230. I'm therefore not sure what to do. Can you figure out a fix and create a PR?

@d-frey d-frey self-assigned this Jan 29, 2023
@sephirot47 sephirot47 changed the title parser_tree.cpp example not compiling in VS 2022, as of PEGTL 2.3.6 parser_tree.cpp example not compiling in VS 2022, as of PEGTL 3.2.6 Jan 30, 2023
@sephirot47
Copy link
Author

Yes, I meant 3.2.6 and 3.2.5 xD (I have already edited the issue and message)
I would really love to fix it myself, but the error trace is pretty obscure. I tried but didn't manage to fix it 😞
If the jobs pass, maybe it's something I have misconfigured locally, but I just downloaded and tested the versions without touching anything, and 3.2.5 worked while 3.2.6 & 3.2.7 don't. Sorry I can not help much more with this 😖

@untrioctium
Copy link

I experienced this on an older version of MSVC, but after upgrading to 19.34.31942.0, I can no longer reproduce. Looks like a fixed compiler bug.

@untrioctium
Copy link

untrioctium commented Feb 22, 2023

I think I may have found the issue, as I experienced it again. Looks like if you have type defined at global scope in your code where parse_tree can see it, MSVC will see this expression at 3.2.7's parse_tree.hpp at line 436:

internal::make_control< Node, Selector, Control >::template type

And not be happy about type there, even though it should be obviously a name under make_control. I guess it is a compiler bug? type might be a silly name to pick at global scope, but I feel like this should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants