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

fix(parse): recognize const and pointer template arguments #521

Merged
merged 3 commits into from
Aug 11, 2023

Conversation

JohelEGP
Copy link
Contributor

@JohelEGP JohelEGP commented Jun 21, 2023

Resolves #502.
Resolves #456.

Testing summary:

100% tests passed, 0 tests failed out of 676

Total Test time (real) =  92.21 sec

Acknowledgements:

@JohelEGP JohelEGP changed the title fix(parse): ignore errors from alternative production fix(parse): recognize const and pointer template arguments Jun 21, 2023
@MaxSagebaum
Copy link
Contributor

LGTM

Maybe test could be extended to also include <**int> or < const * int>. I do not know how decltype(expression()){} behaves. Maybe it is already included and the test does not net to be extended.

@JohelEGP
Copy link
Contributor Author

Are you going to merge this?
What about #531 (comment)?
IMO, that's much better.

Signed-off-by: Herb Sutter <[email protected]>
@hsutter
Copy link
Owner

hsutter commented Aug 11, 2023

Thanks!

@hsutter hsutter merged commit 706ebc8 into hsutter:main Aug 11, 2023
@JohelEGP JohelEGP deleted the ptr_tmp_arg branch August 11, 2023 04:31
@hsutter
Copy link
Owner

hsutter commented Aug 11, 2023

Sorry, just saw your concurrent comment.

@JohelEGP
Copy link
Contributor Author

JohelEGP commented Aug 11, 2023

It's OK.
Any clean up just got a bit harder.

The application of #531 (comment)
will be needed to avoid having typename in Cpp2 (via #533).
In f<x::value>,
x::value is currently an expression.
If we want an implicit typename,
it's necessary to distinguish expressions from types.
So f<x::value> can lower to f<typename x::value>,
and f<(x::value)> can lower to f<x::value>,
or something along those lines, as discussed in the linked issue.

zaucy pushed a commit to zaucy/cppfront that referenced this pull request Dec 5, 2023
* fix(parse): recognize const and pointer template arguments

* Minor: Massage the new code's format and comment

Signed-off-by: Herb Sutter <[email protected]>

* Update parse.h

Signed-off-by: Herb Sutter <[email protected]>

---------

Signed-off-by: Herb Sutter <[email protected]>
Co-authored-by: Herb Sutter <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants