Richard Smith | 20fbdb3 | 2018-09-12 02:13:46 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -fmodules -fmodules-local-submodule-visibility %s -verify -Werror=undefined-inline |
| 2 | |
| 3 | #pragma clang module build A1 |
| 4 | module A1 { export * } |
| 5 | #pragma clang module contents |
| 6 | #pragma clang module begin A1 |
| 7 | template<typename T> class A {}; |
| 8 | template<typename T> inline bool f(const A<T>&) { return T::error; } |
| 9 | #pragma clang module end |
| 10 | #pragma clang module endbuild |
| 11 | |
| 12 | #pragma clang module build A2 |
| 13 | module A2 { export * } |
| 14 | #pragma clang module contents |
| 15 | #pragma clang module begin A2 |
| 16 | #pragma clang module load A1 |
| 17 | template<typename T> class A {}; |
| 18 | template<typename T> inline bool f(const A<T>&) { return T::error; } |
| 19 | #pragma clang module end |
| 20 | #pragma clang module endbuild |
| 21 | |
| 22 | #pragma clang module build A3 |
| 23 | module A3 { export * } |
| 24 | #pragma clang module contents |
| 25 | #pragma clang module begin A3 |
| 26 | template<typename T> class A {}; |
| 27 | template<typename T> inline bool f(const A<T>&) { return T::error; } |
| 28 | #pragma clang module end |
| 29 | #pragma clang module endbuild |
| 30 | |
| 31 | #pragma clang module load A3 |
| 32 | #pragma clang module import A2 |
| 33 | // expected-error@* {{cannot be used prior to}} |
| 34 | bool y(A<int> o) { return f(o); } // expected-note {{instantiation of}} |