Fixes Rust-GCC#3614
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-base.cc (TypeCheckBase::parse_repr_options): check for input
gcc/testsuite/ChangeLog:
* rust/compile/issue-3614.rs: New test.
Signed-off-by: Philip Herron <herron.philip@googlemail.com>
for (const auto &attr : attrs)
{
bool is_repr = attr.get_path ().as_string () == Values::Attributes::REPR;
+ if (is_repr && !attr.has_attr_input ())
+ {
+ rust_error_at (attr.get_locus (), "malformed %qs attribute", "repr");
+ continue;
+ }
+
if (is_repr)
{
const AST::AttrInput &input = attr.get_attr_input ();
--- /dev/null
+#[repr] // { dg-error "malformed .repr. attribute" }
+
+struct _B {}