Richard Smith | 13897eb | 2018-09-12 23:37:00 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -fmodules -emit-llvm-only %s -verify |
| 2 | |
| 3 | #pragma clang module build A |
| 4 | module A {} |
| 5 | #pragma clang module contents |
| 6 | #pragma clang module begin A |
| 7 | template<typename T> void f(const T&) { T::error; } |
| 8 | #pragma clang module end |
| 9 | #pragma clang module endbuild |
| 10 | |
| 11 | #pragma clang module build B |
| 12 | module B {} |
| 13 | #pragma clang module contents |
| 14 | #pragma clang module begin B |
| 15 | template<typename T> void f(const T&) { T::error; } |
| 16 | #pragma clang module end |
| 17 | #pragma clang module endbuild |
| 18 | |
| 19 | #pragma clang module build C |
| 20 | module C {} |
| 21 | #pragma clang module contents |
| 22 | #pragma clang module begin C |
| 23 | #pragma clang module load B |
| 24 | template<typename T> void f(const T&) { T::error; } |
| 25 | #pragma clang module end |
| 26 | #pragma clang module endbuild |
| 27 | |
| 28 | #pragma clang module load A |
| 29 | inline void f() {} |
| 30 | void x() { f(); } |
| 31 | |
| 32 | #pragma clang module import C |
| 33 | // expected-error@* {{cannot be used prior to}} |
| 34 | void y(int n) { f(n); } // expected-note {{instantiation of}} |