| // RUN: %clang_cc1 -fmodules -verify -fno-modules-error-recovery -fno-spell-checking %s |
| // RUN: %clang_cc1 -fmodules -verify -fno-modules-error-recovery -DONLY_Y %s |
| #pragma clang module build a |
| #pragma clang module contents |
| #pragma clang module begin a.x |
| template<typename T> extern int f(T) { return 0; } |
| #pragma clang module begin a.y |
| #pragma clang module import a.x |
| #pragma clang module endbuild |
| namespace N { struct A {}; } |
| #pragma clang module import a.x |
| f(B()); // expected-error {{use of undeclared identifier 'f'}} |
| // expected-no-diagnostics |
| #pragma clang module import a.y |
| // These are OK even if a.x is not imported. |