Debian Codegraph @

clang/test/Modules/pr133720.cppm

raw
1 // RUN: rm -rf %t
2 // RUN: mkdir -p %t
3 // RUN: split-file %s %t
4
5 // RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm
6 // RUN: %clang_cc1 -std=c++20 %t/b.cppm -fmodule-file=a=%t/a.pcm -fsyntax-only -verify
7
8 //--- a.cppm
9 export module a;
10
11 struct Base {
12 template <class T>
13 friend constexpr auto f(T) { return 0; }
14 };
15 export struct A: Base {};
16
17 //--- b.cppm
18 export module b;
19
20 import a;
21
22 namespace n {
23
24 struct B {};
25
26 auto b() -> void {
27 f(A{});
28 f(B{}); // expected-error {{use of undeclared identifier 'f'}}
29 }
30
31 } // namespace n