submodules.cpp revision 6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89
1// RUN: rm -rf %t 2// RUN: %clang_cc1 -x objective-c++ -fmodules-cache-path=%t -fmodules -I %S/Inputs/submodules %s -verify 3// FIXME: When we have a syntax for modules in C++, use that. 4 5@import std.vector; 6 7vector<int> vi; 8 9// Note: remove_reference is not visible yet. 10remove_reference<int&>::type *int_ptr = 0; // expected-error{{declaration of 'remove_reference' must be imported from module 'std.type_traits' before it is required}} 11// expected-note@Inputs/submodules/type_traits.h:2{{previous}} 12// expected-note@Inputs/submodules/hash_map.h:1{{previous}} 13 14@import std.typetraits; // expected-error{{no submodule named 'typetraits' in module 'std'; did you mean 'type_traits'?}} 15 16vector<float> vf; 17remove_reference<int&>::type *int_ptr2 = 0; 18 19@import std.vector.compare; // expected-error{{no submodule named 'compare' in module 'std.vector'}} 20 21@import std; // import everything in 'std' 22 23// hash_map still isn't available. 24hash_map<int, float> ints_to_floats; // expected-error{{declaration of 'hash_map' must be imported from module 'std.hash_map' before it is required}} 25 26@import std.hash_map; 27 28hash_map<int, float> ints_to_floats2; 29