gcc/rust/ChangeLog:
* ast/rust-ast.cc (Attribute::check_cfg_predicate):
Make error.
gcc/testsuite/ChangeLog:
* rust/compile/issue-4267.rs: New test.
Signed-off-by: Lucas Ly Ba <lucas.ly-ba@outlook.com>
"malformed %<cfg_attr%> attribute input");
return false;
}
+
+ if (string_path == Values::Attributes::CFG
+ && meta_item.get_items ().size () != 1)
+ {
+ rust_error_at (path.get_locus (), "multiple %qs predicates are specified",
+ path.as_string ().c_str ());
+ return false;
+ }
return meta_item.get_items ().front ()->check_cfg_predicate (session);
}
--- /dev/null
+#[cfg(a,a)]
+// { dg-error "multiple .cfg. predicates are specified" "" { target *-*-* } .-1 }
+fn a(){}