Debian Codegraph @

gcc/testsuite/g++.dg/modules/dguide-1_a.C

raw
1 // PR c++/115231
2 // { dg-additional-options "-fmodules-ts -Wno-global-module" }
3 // { dg-module-cmi M }
4
5 module;
6
7 template <typename T>
8 struct A {
9 template <typename U> A(U);
10 };
11
12 template <typename T> A(T) -> A<T>;
13
14 export module M;
15
16 // Exporting a GMF entity should make the deduction guides reachable.
17 export using ::A;
18
19
20 export template <typename T>
21 struct B {
22 template <typename U> B(U);
23 };
24
25 // Not exported, but should still be reachable by [temp.deduct.guide] p1.
26 B(int) -> B<double>;
27
28
29 // Class-scope deduction guides should be reachable as well, even if
30 // the class body was not exported.
31 export template <typename T> struct C;
32
33 template <typename T>
34 struct C {
35 template <typename U>
36 struct I {
37 template <typename V> I(V);
38 };
39
40 I(int) -> I<int>;
41
42 template <typename P>
43 I(const P*) -> I<P>;
44 };