Richard Smith | 05ce1d3 | 2018-03-01 22:20:13 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fmodules -std=c++14 %s -verify |
| 2 | // expected-no-diagnostics |
| 3 | |
| 4 | #pragma clang module build A |
| 5 | module A {} |
| 6 | #pragma clang module contents |
| 7 | #pragma clang module begin A |
| 8 | template<typename T> struct A { |
| 9 | friend A operator+(const A&, const A&) { return {}; } |
Serge Pavlov | acfcd78 | 2018-12-06 09:35:04 +0000 | [diff] [blame] | 10 | template<typename T2> friend void func_1(const A&, const T2 &) {} |
Richard Smith | 05ce1d3 | 2018-03-01 22:20:13 +0000 | [diff] [blame] | 11 | }; |
| 12 | #pragma clang module end |
| 13 | #pragma clang module endbuild |
| 14 | |
| 15 | #pragma clang module build B |
| 16 | module B {} |
| 17 | #pragma clang module contents |
| 18 | #pragma clang module begin B |
| 19 | #pragma clang module import A |
| 20 | inline void f() { A<int> a; } |
| 21 | #pragma clang module end |
| 22 | #pragma clang module endbuild |
| 23 | |
| 24 | #pragma clang module build C |
| 25 | module C {} |
| 26 | #pragma clang module contents |
| 27 | #pragma clang module begin C |
| 28 | #pragma clang module import A |
| 29 | inline void g() { A<int> a; } |
| 30 | #pragma clang module end |
| 31 | #pragma clang module endbuild |
| 32 | |
| 33 | #pragma clang module import A |
| 34 | #pragma clang module import B |
| 35 | #pragma clang module import C |
| 36 | |
| 37 | void h() { |
| 38 | A<int> a; |
| 39 | a + a; |
Serge Pavlov | acfcd78 | 2018-12-06 09:35:04 +0000 | [diff] [blame] | 40 | func_1(a, 0); |
Richard Smith | 05ce1d3 | 2018-03-01 22:20:13 +0000 | [diff] [blame] | 41 | } |