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

Reject regular variadic functions #2748

Merged
merged 2 commits into from Nov 21, 2023

Conversation

P-E-P
Copy link
Member

@P-E-P P-E-P commented Nov 20, 2023

Variadic regular functions were recently added in the parser as they should be rejected in the ast validation pass. Those are now rejected in the ast validation pass.

Fixes #2712

Variadic regular functions were recently added in the parser as they
should be rejected in the ast validation pass. This commit add the ast
validation pass rejecting this kind of variadic arguments.

gcc/rust/ChangeLog:

	* checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add
	ast validation pass to reject variadic arguments on regular functions.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
@P-E-P P-E-P added this to the GCC 14.1 release milestone Nov 20, 2023
@P-E-P P-E-P self-assigned this Nov 20, 2023
Add a new regression test for the error message in regular function
variadic errors during ast validation pass.

gcc/testsuite/ChangeLog:

	* rust/compile/non_foreign_variadic_function.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
@P-E-P P-E-P marked this pull request as ready for review November 20, 2023 10:41
Copy link
Member

@CohenArthur CohenArthur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great stuff! love the AST validation pass

@P-E-P P-E-P added this pull request to the merge queue Nov 21, 2023
Merged via the queue into Rust-GCC:master with commit 0f9752e Nov 21, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Variadic functions are unstable
2 participants