Commit 23de527
util/attributes: handle #[export_name] on static items
This patch enables validation for the #[export_name] attribute when used
on static items. It reuses the validation logic introduced for functions
to ensure that statics also receive compile-time checks for malformed
inputs (e.g. non-string literals).
Fixes #4388
gcc/rust/ChangeLog:
* util/rust-attributes.cc (AttributeChecker::visit): Add check for
export_name on static items.
gcc/testsuite/ChangeLog:
* rust/compile/issue-4388.rs: New test.
Signed-off-by: Jayant Chauhan <[email protected]>1 parent 5b9706f commit 23de527
File tree
2 files changed
+22
-2
lines changed- gcc
- rust/util
- testsuite/rust/compile
2 files changed
+22
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1016 | 1016 | | |
1017 | 1017 | | |
1018 | 1018 | | |
1019 | | - | |
| 1019 | + | |
1020 | 1020 | | |
1021 | | - | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
1022 | 1029 | | |
1023 | 1030 | | |
1024 | 1031 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
0 commit comments