]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Add a new test for const without body
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Thu, 26 Oct 2023 13:48:52 +0000 (15:48 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:13:11 +0000 (19:13 +0100)
This new regression test highlight the fixed behavior for 2709.

gcc/testsuite/ChangeLog:

* rust/compile/issue-2709.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/testsuite/rust/compile/issue-2709.rs [new file with mode: 0644]

diff --git a/gcc/testsuite/rust/compile/issue-2709.rs b/gcc/testsuite/rust/compile/issue-2709.rs
new file mode 100644 (file)
index 0000000..42fe7af
--- /dev/null
@@ -0,0 +1,8 @@
+fn main() {}
+
+struct S;
+
+impl S {
+    const Y: u8;
+    // { dg-error "associated constant in .impl. without body" "" { target *-*-* } .-1 }
+}