[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Modules / submodules.cpp
blobe4a31db0e5339106c8fe3119cd559655955f727f
1 // RUN: rm -rf %t
2 // RUN: %clang_cc1 -x objective-c++ -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs/submodules %s -verify
3 // FIXME: When we have a syntax for modules in C++, use that.
5 @import std.vector;
7 vector<int> vi;
9 // Note: remove_reference is not visible yet.
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{{not visible}}
12 // expected-note@Inputs/submodules/hash_map.h:1{{not visible}}
14 @import std.typetraits; // expected-error{{no submodule named 'typetraits' in module 'std'; did you mean 'type_traits'?}}
16 vector<float> vf;
17 remove_reference<int&>::type *int_ptr2 = 0;
19 @import std.vector.compare; // expected-error{{no submodule named 'compare' in module 'std.vector'}}
21 @import std; // import everything in 'std'
23 // hash_map still isn't available.
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}}
26 @import std.hash_map;
28 hash_map<int, float> ints_to_floats2;