From 297bc80eab5128e1cde7cd597368109a033b6cc0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 28 Sep 2016 18:03:28 +0200 Subject: Update idea: C++ modules support Add module test for Clang and VC --- build2/cxx-modules/modtest/bar | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 build2/cxx-modules/modtest/bar (limited to 'build2/cxx-modules/modtest/bar') diff --git a/build2/cxx-modules/modtest/bar b/build2/cxx-modules/modtest/bar new file mode 100644 index 0000000..bc14c7c --- /dev/null +++ b/build2/cxx-modules/modtest/bar @@ -0,0 +1,43 @@ +// file : bar -*- C++ -*- +// copyright : Copyright (c) 2014-2016 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +// #include + +// Define bar module interface. +// +// For VC must be included only into module implementation (bar.cxx). The +// module should be imported into consumer file with import declaration. +// +// For CLang must be #included into both module implementation and consumer +// files. +// + +#if defined(MODTEST_USE_MODULES) && defined(_MSC_VER) +module bar; +export +{ +#endif + +int +bar_value (int v); + +struct bar +{ + explicit bar (int v); + + int + value (); + +// std::string +// message (const char* s) const; + +private: + int v_; +}; + +// Close module export declaration. +// +#if defined(MODTEST_USE_MODULES) && defined(_MSC_VER) +} +#endif -- cgit v1.1