From: Pierre-Emmanuel Patry Date: Wed, 22 Nov 2023 12:22:42 +0000 (+0100) Subject: gccrs: Add regression test for const fn in trait X-Git-Tag: basepoints/gcc-15~1559 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ab257dcd66cd2532beb0c74b836147d02a9ed3bb;p=thirdparty%2Fgcc.git gccrs: Add regression test for const fn in trait Const fn declaration in trait declarations shall emit an error. This new test highlight this behavior. gcc/testsuite/ChangeLog: * rust/compile/const_trait_fn.rs: New test. Signed-off-by: Pierre-Emmanuel Patry --- diff --git a/gcc/testsuite/rust/compile/const_trait_fn.rs b/gcc/testsuite/rust/compile/const_trait_fn.rs new file mode 100644 index 000000000000..cff2f5f096e5 --- /dev/null +++ b/gcc/testsuite/rust/compile/const_trait_fn.rs @@ -0,0 +1,4 @@ +trait Osterkz { + const fn x(); + // { dg-error "functions in traits cannot be declared const .E0379." "" { target *-*-* } .-1 } +}