diff options
| author | Douglas Gregor <dgregor@apple.com> | 2012-01-03 19:32:59 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2012-01-03 19:32:59 +0000 |
| commit | c13a34b690d2dc2a03c2fea75a0a1438636c19ce (patch) | |
| tree | 20cdb1b697928adbdefe4435eff3f584e4df85df /test/Modules/submodules.cpp | |
| parent | f84d560fc73c9177af9081a0edf6726e43ec3a63 (diff) | |
| download | clang-c13a34b690d2dc2a03c2fea75a0a1438636c19ce.tar.gz clang-c13a34b690d2dc2a03c2fea75a0a1438636c19ce.tar.bz2 clang-c13a34b690d2dc2a03c2fea75a0a1438636c19ce.tar.xz | |
Eliminate the uglified keyword __import_module__ for importing
modules. This leaves us without an explicit syntax for importing
modules in C/C++, because such a syntax needs to be discussed
first. In Objective-C/Objective-C++, the @import syntax is used to
import modules.
Note that, under -fmodules, C/C++ programs can import modules via the
#include mechanism when a module map is in place for that header. This
allows us to work with modules in C/C++ without committing to a syntax.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147467 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Modules/submodules.cpp')
| -rw-r--r-- | test/Modules/submodules.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/test/Modules/submodules.cpp b/test/Modules/submodules.cpp index b62d48719a..1417446416 100644 --- a/test/Modules/submodules.cpp +++ b/test/Modules/submodules.cpp @@ -1,7 +1,8 @@ // RUN: rm -rf %t -// RUN: %clang_cc1 -fmodule-cache-path %t -fmodules -I %S/Inputs/submodules %s -verify +// RUN: %clang_cc1 -x objective-c++ -fmodule-cache-path %t -fmodules -I %S/Inputs/submodules %s -verify +// FIXME: When we have a syntax for modules in C++, use that. -__import_module__ std.vector; +@import std.vector; vector<int> vi; @@ -9,20 +10,20 @@ vector<int> vi; remove_reference<int&>::type *int_ptr = 0; // expected-error{{unknown type name 'remove_reference'}} \ // expected-error{{expected unqualified-id}} -__import_module__ std.typetraits; // expected-error{{no submodule named 'typetraits' in module 'std'; did you mean 'type_traits'?}} +@import std.typetraits; // expected-error{{no submodule named 'typetraits' in module 'std'; did you mean 'type_traits'?}} vector<float> vf; remove_reference<int&>::type *int_ptr2 = 0; -__import_module__ std.vector.compare; // expected-error{{no submodule named 'compare' in module 'std.vector'}} +@import std.vector.compare; // expected-error{{no submodule named 'compare' in module 'std.vector'}} -__import_module__ std; // import everything in 'std' +@import std; // import everything in 'std' // hash_map still isn't available. hash_map<int, float> ints_to_floats; // expected-error{{unknown type name 'hash_map'}} \ // expected-error{{expected unqualified-id}} -__import_module__ std.hash_map; +@import std.hash_map; hash_map<int, float> ints_to_floats2; |
