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(cpp1): emit requires clause in forward declaration #486

Merged
merged 4 commits into from
Jul 30, 2023

Conversation

JohelEGP
Copy link
Contributor

@JohelEGP JohelEGP commented Jun 2, 2023

Resolves #323.

See it working:

GCC 10 can never work in type scope: https://cpp2.godbolt.org/z/a7Pq6exdj.

Testing summary.
100% tests passed, 0 tests failed out of 508

Total Test time (real) = 118.30 sec
Acknowledgements.

JohelEGP and others added 2 commits June 2, 2023 08:25
@JohelEGP
Copy link
Contributor Author

JohelEGP commented Jun 9, 2023

The added test will fail for GCC10.

@JohelEGP
Copy link
Contributor Author

Without this, one can't write usable constrained overloads in Cpp2.
See thread starting at #492 (comment) (3 comments).
One can write a constrained function (non-overloaded).
Any error just moves from a clear compile-time error to a more cryptic link-time error.

@hsutter
Copy link
Owner

hsutter commented Jul 30, 2023

Looks good, thanks!

Signed-off-by: Herb Sutter <[email protected]>
@hsutter hsutter merged commit 08806e3 into hsutter:main Jul 30, 2023
@JohelEGP JohelEGP deleted the requires_in_fwd_decl branch July 30, 2023 21:08
zaucy pushed a commit to zaucy/cppfront that referenced this pull request Dec 5, 2023
* fix(cpp1): emit requires clause in forward declaration

* refactor: prevent warning on token-eating macro

Co-authored-by: Max Sagebaum <[email protected]>
Signed-off-by: Johel Ernesto Guerrero Peña <[email protected]>

* test: add `test-results/gcc-13`

* Delete gcc-version.output

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

---------

Signed-off-by: Johel Ernesto Guerrero Peña <[email protected]>
Signed-off-by: Herb Sutter <[email protected]>
Co-authored-by: Max Sagebaum <[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