Richard Smith | 82b8d4e | 2015-12-18 22:19:11 +0000 | [diff] [blame] | 1 | // RUN: rm -rf %t |
| 2 | // RUN: mkdir %t |
| 3 | // RUN: echo 'struct X {}; struct Y : X { friend int f(Y); };' > %t/a.h |
| 4 | // RUN: echo 'module a { header "a.h" }' > %t/map |
| 5 | // RUN: %clang_cc1 -fmodules -x c++ -emit-module -fmodule-name=a %t/map -o %t/a.pcm |
| 6 | // RUN: %clang_cc1 -fmodules -x c++ -verify -fmodule-file=%t/a.pcm %s -fno-modules-error-recovery |
| 7 | |
| 8 | struct X; |
| 9 | struct Y; |
| 10 | |
| 11 | // Ensure that we can't use the definitions of X and Y, since we've not imported module a. |
| 12 | Y *yp; |
| 13 | X *xp = yp; // expected-error {{cannot initialize}} |
| 14 | _Static_assert(!__is_convertible(Y*, X*), ""); |
| 15 | X &xr = *yp; // expected-error {{unrelated type}} |
| 16 | int g(Y &y) { f(y); } // expected-error {{undeclared identifier 'f'}} |