1 // RUN: %clang_cc1 -std=c++14 -fmodules %s -verify
2 // RUN: %clang_cc1 -std=c++14 -fmodules %s -verify -triple i686-windows
3 // expected-no-diagnostics
4 #pragma clang module build A
6 #pragma clang module contents
7 #pragma clang module begin A
8 template<typename T
> struct ct
{ friend auto operator-(ct
, ct
) { struct X
{}; return X(); } void x(); };
9 #pragma clang module end
10 #pragma clang module endbuild
12 #pragma clang module build B
14 #pragma clang module contents
15 #pragma clang module begin B
16 template<typename T
> struct ct
{ friend auto operator-(ct
, ct
) { struct X
{}; return X(); } void x(); };
17 inline auto f() { return ct
<float>() - ct
<float>(); }
18 #pragma clang module end
19 #pragma clang module endbuild
21 // Force the definition of ct in module A to be the primary definition.
22 #pragma clang module import A
23 template<typename T
> void ct
<T
>::x() {}
25 // Attempt to cause the definition of operator- in the ct primary template in
26 // module B to be the primary definition of that function. If that happens,
27 // we'll be left with a class template ct that appears to not contain a
28 // definition of the inline friend function.
29 #pragma clang module import B