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 | da82e703d1d9e39fd5acdf18e06855e452c87984 (patch) | |
tree | c148834214171b1c8467de34396e2601d68d646a /clang/test/Modules/submodules.cpp | |
parent | c2f91c37e83a54c649582120827a25862a10f312 (diff) | |
download | bcm5719-llvm-da82e703d1d9e39fd5acdf18e06855e452c87984.tar.gz bcm5719-llvm-da82e703d1d9e39fd5acdf18e06855e452c87984.zip |
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.
llvm-svn: 147467
Diffstat (limited to 'clang/test/Modules/submodules.cpp')
-rw-r--r-- | clang/test/Modules/submodules.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/test/Modules/submodules.cpp b/clang/test/Modules/submodules.cpp index b62d48719ae..1417446416c 100644 --- a/clang/test/Modules/submodules.cpp +++ b/clang/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; |