From d1fd8beee890a1beb4ef63ad9b9cd476b2e8bc5b Mon Sep 17 00:00:00 2001 From: Arthur LAURENT Date: Tue, 13 May 2025 20:22:03 +0200 Subject: (C++ modules support) add tests --- .../c++/modules/namespace/src/hello_impl.cpp | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/projects/c++/modules/namespace/src/hello_impl.cpp (limited to 'tests/projects/c++/modules/namespace/src/hello_impl.cpp') diff --git a/tests/projects/c++/modules/namespace/src/hello_impl.cpp b/tests/projects/c++/modules/namespace/src/hello_impl.cpp new file mode 100644 index 000000000..064afebad --- /dev/null +++ b/tests/projects/c++/modules/namespace/src/hello_impl.cpp @@ -0,0 +1,23 @@ +module; +#include + +module hello; +import mod; + +void inner() { + std::cout << "hello world! data: " + << mod::foo() << std::endl; +} + +namespace hello { + int data__; + void say_hello() { ::inner(); } + + say::say(int data) : data_{data} { + } + + void say::hello() { + hello::data__ = data_; + ::inner(); + } +} -- cgit v1.3.1