aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Modules/pr133720.cppm
blob: ba3f352857a18899216a55f3434fa3b323648350 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t

// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm
// RUN: %clang_cc1 -std=c++20 %t/b.cppm -fmodule-file=a=%t/a.pcm -fsyntax-only -verify

//--- a.cppm
export module a;

struct Base {
    template <class T>
    friend constexpr auto f(T) { return 0; }
};
export struct A: Base {};

//--- b.cppm
export module b;

import a;

namespace n {

struct B {};

auto b() -> void {
	f(A{});
    f(B{}); // expected-error {{use of undeclared identifier 'f'}}
}

} // namespace n