From 6bab515e009f247a2260180442cadbc09a76542d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bertold=20Br=C3=B6dner?= Date: Tue, 9 Apr 2024 18:14:45 +0200 Subject: [PATCH] added failing test for issue https://github.com/google/autocxx/issues/1370 --- integration-tests/tests/integration_test.rs | 32 +++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/integration-tests/tests/integration_test.rs b/integration-tests/tests/integration_test.rs index 0939caecc..942cb7bce 100644 --- a/integration-tests/tests/integration_test.rs +++ b/integration-tests/tests/integration_test.rs @@ -12386,6 +12386,38 @@ fn test_cpp_union_pod() { run_test_expect_fail("", hdr, quote! {}, &[], &["CorrelationId_t_"]); } +#[test] +fn test_issue_1370() { + let hdr = indoc! {" + + template class B{ + public: + T& data; + }; + + class C{}; + + class A{ + public: + B data; + }; + + B& getInner(A& outer){ + return outer.data; + } + "}; + let dir = quote! { + generate!("A") + generate!("B") + generate!("C") + concrete!("B", B_C) + + generate!("getInner") + }; + run_test_ex("", hdr, quote! {}, dir, None, None, None); + // run_test("", hdr, rs, &[], &[]); +} + // Yet to test: // - Ifdef // - Out param pointers