Douglas Gregor | 5196bc6 | 2011-11-30 04:03:44 +0000 | [diff] [blame] | 1 | // RUN: rm -rf %t |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -x objective-c++ -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs/submodules %s -verify |
Douglas Gregor | da82e70 | 2012-01-03 19:32:59 +0000 | [diff] [blame] | 3 | // FIXME: When we have a syntax for modules in C++, use that. |
Douglas Gregor | 5196bc6 | 2011-11-30 04:03:44 +0000 | [diff] [blame] | 4 | |
Douglas Gregor | c50d492 | 2012-12-11 22:11:52 +0000 | [diff] [blame] | 5 | @import std.vector; |
Douglas Gregor | cf68c58 | 2011-12-01 22:20:10 +0000 | [diff] [blame] | 6 | |
| 7 | vector<int> vi; |
| 8 | |
| 9 | // Note: remove_reference is not visible yet. |
Richard Smith | e156254d | 2013-08-20 20:35:18 +0000 | [diff] [blame] | 10 | 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}} |
| 11 | // expected-note@Inputs/submodules/type_traits.h:2{{previous}} |
| 12 | // expected-note@Inputs/submodules/hash_map.h:1{{previous}} |
Douglas Gregor | cf68c58 | 2011-12-01 22:20:10 +0000 | [diff] [blame] | 13 | |
Douglas Gregor | c50d492 | 2012-12-11 22:11:52 +0000 | [diff] [blame] | 14 | @import std.typetraits; // expected-error{{no submodule named 'typetraits' in module 'std'; did you mean 'type_traits'?}} |
Douglas Gregor | cf68c58 | 2011-12-01 22:20:10 +0000 | [diff] [blame] | 15 | |
| 16 | vector<float> vf; |
| 17 | remove_reference<int&>::type *int_ptr2 = 0; |
| 18 | |
Douglas Gregor | c50d492 | 2012-12-11 22:11:52 +0000 | [diff] [blame] | 19 | @import std.vector.compare; // expected-error{{no submodule named 'compare' in module 'std.vector'}} |
Douglas Gregor | cf68c58 | 2011-12-01 22:20:10 +0000 | [diff] [blame] | 20 | |
Douglas Gregor | c50d492 | 2012-12-11 22:11:52 +0000 | [diff] [blame] | 21 | @import std; // import everything in 'std' |
Douglas Gregor | cf68c58 | 2011-12-01 22:20:10 +0000 | [diff] [blame] | 22 | |
| 23 | // hash_map still isn't available. |
Richard Smith | e156254d | 2013-08-20 20:35:18 +0000 | [diff] [blame] | 24 | 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}} |
Douglas Gregor | cf68c58 | 2011-12-01 22:20:10 +0000 | [diff] [blame] | 25 | |
Douglas Gregor | c50d492 | 2012-12-11 22:11:52 +0000 | [diff] [blame] | 26 | @import std.hash_map; |
Douglas Gregor | cf68c58 | 2011-12-01 22:20:10 +0000 | [diff] [blame] | 27 | |
| 28 | hash_map<int, float> ints_to_floats2; |