clang/test/CXX/module/module.reach/p5.cpp
raw| 1 | // RUN: rm -rf %t |
| 2 | // RUN: mkdir -p %t |
| 3 | // RUN: split-file %s %t |
| 4 | // |
| 5 | // RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-module-interface -o %t/A.pcm |
| 6 | // RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/B.cppm -fsyntax-only -verify |
| 7 | // |
| 8 | //--- A.cppm |
| 9 | export module A; |
| 10 | struct X {}; |
| 11 | export using Y = X; |
| 12 | |
| 13 | //--- B.cppm |
| 14 | export module B; |
| 15 | import A; |
| 16 | Y y; // OK, definition of Y is reachable |
| 17 | X x; // expected-error {{unknown type name 'X'}} |