Debian Codegraph @

gcc/testsuite/g++.dg/modules/gmf-3.C

raw
1 // PR c++/114630
2 // { dg-additional-options "-fmodules-ts -Wno-global-module -fdump-lang-module" }
3 // { dg-module-cmi M }
4
5 module;
6 template <typename> struct allocator {
7 allocator() {}
8 };
9 template class allocator<wchar_t>;
10
11 // Deferred instantiation of GM virtual functions or friend functions
12 // should not place newly discovered declarations in the module purview.
13 template <typename T>
14 void go() {
15 extern T fn_decl();
16 }
17 template <typename T>
18 struct S {
19 friend void x() {}
20 virtual void f() {
21 go<char>();
22 }
23 };
24 inline S<int> s;
25
26 export module M;
27
28 // The whole GMF should be discarded here
29 // { dg-final { scan-lang-dump "Wrote 0 clusters" module } }