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
8struct X;
9struct Y;
10
11// Ensure that we can't use the definitions of X and Y, since we've not imported module a.
12Y *yp;
13X *xp = yp; // expected-error {{cannot initialize}}
14_Static_assert(!__is_convertible(Y*, X*), "");
15X &xr = *yp; // expected-error {{unrelated type}}
16int g(Y &y) { f(y); } // expected-error {{undeclared identifier 'f'}}
17