We want to prevent regressions on struct expr field attribute parsing.
gcc/testsuite/ChangeLog:
* rust/compile/struct_expr_field_attributes.rs: New test.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
--- /dev/null
+pub struct Test {
+ #[cfg(not(any(
+ target_os = "solaris",
+ target_os = "illumos",
+ target_os = "fuchsia",
+ target_os = "redox",
+ )))]
+ value: bool,
+ // { dg-warning "field is never read" "" { target *-*-* } .-1 }
+}
+
+pub fn test() -> Test {
+ Test {
+ #[cfg(not(any(
+ target_os = "solaris",
+ target_os = "illumos",
+ target_os = "fuchsia",
+ target_os = "redox",
+ )))]
+ value: false,
+ }
+}