2011-11-30 12:03:44 +08:00
// RUN: rm -rf %t
2015-06-16 08:08:24 +08:00
// RUN: %clang_cc1 -x objective-c++ -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs/submodules %s -verify
2012-01-04 03:32:59 +08:00
// FIXME: When we have a syntax for modules in C++, use that.
2011-11-30 12:03:44 +08:00
2012-12-12 06:11:52 +08:00
@ import std . vector ;
2011-12-02 06:20:10 +08:00
vector < int > vi ;
// Note: remove_reference is not visible yet.
2013-08-21 04:35:18 +08:00
remove_reference < int & > : : type * int_ptr = 0 ; // expected-error{{declaration of 'remove_reference' must be imported from module 'std.type_traits' before it is required}}
2020-04-29 09:22:34 +08:00
// expected-note@Inputs/submodules/type_traits.h:2{{not visible}}
// expected-note@Inputs/submodules/hash_map.h:1{{not visible}}
2011-12-02 06:20:10 +08:00
2012-12-12 06:11:52 +08:00
@ import std . typetraits ; // expected-error{{no submodule named 'typetraits' in module 'std'; did you mean 'type_traits'?}}
2011-12-02 06:20:10 +08:00
vector < float > vf ;
remove_reference < int & > : : type * int_ptr2 = 0 ;
2012-12-12 06:11:52 +08:00
@ import std . vector . compare ; // expected-error{{no submodule named 'compare' in module 'std.vector'}}
2011-12-02 06:20:10 +08:00
2012-12-12 06:11:52 +08:00
@ import std ; // import everything in 'std'
2011-12-02 06:20:10 +08:00
// hash_map still isn't available.
2013-08-21 04:35:18 +08:00
hash_map < int , float > ints_to_floats ; // expected-error{{declaration of 'hash_map' must be imported from module 'std.hash_map' before it is required}}
2011-12-02 06:20:10 +08:00
2012-12-12 06:11:52 +08:00
@ import std . hash_map ;
2011-12-02 06:20:10 +08:00
hash_map < int , float > ints_to_floats2 ;