From 1113ea6241fb7b70a6b3470fc7cbd916d671eb24 Mon Sep 17 00:00:00 2001 From: Steffen Lindner Date: Mon, 10 Feb 2025 14:45:04 +0100 Subject: [PATCH] Add failing test case for #1435 --- integration-tests/tests/integration_test.rs | 40 +++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/integration-tests/tests/integration_test.rs b/integration-tests/tests/integration_test.rs index be7f62397..e8784b2f1 100644 --- a/integration-tests/tests/integration_test.rs +++ b/integration-tests/tests/integration_test.rs @@ -7686,6 +7686,46 @@ fn test_pv_subclass_const() { ); } +#[test] +fn test_pv_subclass_noexcept() { + let hdr = indoc! {" + #include + + class Observer { + public: + Observer() {} + virtual void foo() noexcept = 0; + virtual ~Observer() {} + }; + inline void bar() {} + "}; + run_test_ex( + "", + hdr, + quote! { + MyObserver::new_rust_owned(MyObserver { a: 3, cpp_peer: Default::default() }); + }, + quote! { + generate!("bar") + subclass!("Observer",MyObserver) + }, + None, + None, + Some(quote! { + use autocxx::subclass::CppSubclass; + use ffi::Observer_methods; + #[autocxx::subclass::subclass] + pub struct MyObserver { + a: u32 + } + impl Observer_methods for MyObserver { + fn foo(&self) { + } + } + }), + ); +} + #[test] fn test_pv_subclass_calls_impossible() { let hdr = indoc! {"