summaryrefslogtreecommitdiff
path: root/tests/projects/c++/modules/class_cmake/src
diff options
context:
space:
mode:
Diffstat (limited to 'tests/projects/c++/modules/class_cmake/src')
-rw-r--r--tests/projects/c++/modules/class_cmake/src/hello.mpp11
-rw-r--r--tests/projects/c++/modules/class_cmake/src/hello_impl.cpp14
-rw-r--r--tests/projects/c++/modules/class_cmake/src/main.cpp7
3 files changed, 32 insertions, 0 deletions
diff --git a/tests/projects/c++/modules/class_cmake/src/hello.mpp b/tests/projects/c++/modules/class_cmake/src/hello.mpp
new file mode 100644
index 000000000..268964aa3
--- /dev/null
+++ b/tests/projects/c++/modules/class_cmake/src/hello.mpp
@@ -0,0 +1,11 @@
+export module hello;
+
+export namespace hello {
+ class say {
+ public:
+ say(int data);
+ void hello();
+ private:
+ int data_;
+ };
+}
diff --git a/tests/projects/c++/modules/class_cmake/src/hello_impl.cpp b/tests/projects/c++/modules/class_cmake/src/hello_impl.cpp
new file mode 100644
index 000000000..5dd555a7a
--- /dev/null
+++ b/tests/projects/c++/modules/class_cmake/src/hello_impl.cpp
@@ -0,0 +1,14 @@
+module;
+#include <iostream>
+
+module hello;
+
+using namespace std;
+namespace hello {
+ say::say(int data) : data_(data) {
+
+ }
+ void say::hello() {
+ cout << "hello, say class: " << data_ << endl;
+ }
+}
diff --git a/tests/projects/c++/modules/class_cmake/src/main.cpp b/tests/projects/c++/modules/class_cmake/src/main.cpp
new file mode 100644
index 000000000..b96807bda
--- /dev/null
+++ b/tests/projects/c++/modules/class_cmake/src/main.cpp
@@ -0,0 +1,7 @@
+import hello;
+
+int main() {
+ hello::say s(sizeof(hello::say));
+ s.hello();
+ return 0;
+}