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

[E0534] inline attribute was malformed #2558

Merged
merged 1 commit into from
Aug 16, 2023

Conversation

MahadMuhammad
Copy link
Contributor

Invalid number of inline attributes - E0534

Inline attribute takes one argument, but
more than one argument was found.

Running Testcases:

/home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/inline_2.rs:2:3: error: unknown inline option
    2 | #[inline(A)] // { dg-error "unknown inline option" }
      |   ^~~~~~
/home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/inline_2.rs:5:3: error: invalid number of arguments [E0534]
    5 | #[inline(A, B)] // { dg-error "invalid number of arguments" }
      |   ^~~~~~
      |   expected one argument
/home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/inline_2.rs:8:3: error: invalid number of arguments [E0534]
    8 | #[inline()] // { dg-error "invalid number of arguments" }
      |   ^~~~~~
      |   expected one argument

gcc/rust/ChangeLog:

* backend/rust-compile-base.cc (HIRCompileBase::handle_inline_attribute_on_fndecl): Added rich_location & error code.

gcc/testsuite/ChangeLog:

* rust/compile/inline_2.rs: Added new case.

Inline attribute takes one argument, but
more than one argument was found.

gcc/rust/ChangeLog:

	* backend/rust-compile-base.cc (HIRCompileBase::handle_inline_attribute_on_fndecl):
	Added rich_location & error code.

gcc/testsuite/ChangeLog:

	* rust/compile/inline_2.rs: Added new case.

Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
Copy link
Member

@philberty philberty left a comment

Choose a reason for hiding this comment

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

LGTM

@philberty philberty added the diagnostic diagnostic static analysis label Aug 16, 2023
@philberty philberty added this to the GCC 14 Stage 3 milestone Aug 16, 2023
@philberty philberty added this pull request to the merge queue Aug 16, 2023
Merged via the queue into Rust-GCC:master with commit 5545c75 Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
diagnostic diagnostic static analysis
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants