]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
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)
committerCohenArthur <arthur.cohen@embecosm.com>
Mon, 6 Nov 2023 17:13:22 +0000 (17:13 +0000)
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 }
+}