blob: 1417446416cdc2d91623efc6c3724cc879640009 [file] [log] [blame]
Douglas Gregor49009ec2011-11-30 04:03:44 +00001// RUN: rm -rf %t
Douglas Gregorc13a34b2012-01-03 19:32:59 +00002// RUN: %clang_cc1 -x objective-c++ -fmodule-cache-path %t -fmodules -I %S/Inputs/submodules %s -verify
3// FIXME: When we have a syntax for modules in C++, use that.
Douglas Gregor49009ec2011-11-30 04:03:44 +00004
Douglas Gregorc13a34b2012-01-03 19:32:59 +00005@import std.vector;
Douglas Gregorecc2c092011-12-01 22:20:10 +00006
7vector<int> vi;
8
9// Note: remove_reference is not visible yet.
10remove_reference<int&>::type *int_ptr = 0; // expected-error{{unknown type name 'remove_reference'}} \
11// expected-error{{expected unqualified-id}}
12
Douglas Gregorc13a34b2012-01-03 19:32:59 +000013@import std.typetraits; // expected-error{{no submodule named 'typetraits' in module 'std'; did you mean 'type_traits'?}}
Douglas Gregorecc2c092011-12-01 22:20:10 +000014
15vector<float> vf;
16remove_reference<int&>::type *int_ptr2 = 0;
17
Douglas Gregorc13a34b2012-01-03 19:32:59 +000018@import std.vector.compare; // expected-error{{no submodule named 'compare' in module 'std.vector'}}
Douglas Gregorecc2c092011-12-01 22:20:10 +000019
Douglas Gregorc13a34b2012-01-03 19:32:59 +000020@import std; // import everything in 'std'
Douglas Gregorecc2c092011-12-01 22:20:10 +000021
22// hash_map still isn't available.
23hash_map<int, float> ints_to_floats; // expected-error{{unknown type name 'hash_map'}} \
24// expected-error{{expected unqualified-id}}
25
Douglas Gregorc13a34b2012-01-03 19:32:59 +000026@import std.hash_map;
Douglas Gregorecc2c092011-12-01 22:20:10 +000027
28hash_map<int, float> ints_to_floats2;
29