Debian Codegraph @

gcc/testsuite/g++.dg/modules/inst-7_a.C

raw
1 // PR c++/122625
2 // { dg-additional-options "-fmodules" }
3 // { dg-module-cmi M }
4
5 export module M;
6 struct integral_constant {
7 void f() const {}
8 };
9 struct span {
10 template <int> static constexpr integral_constant __v{};
11 template <int, int> static constexpr integral_constant partial{};
12 };
13 template <int x> constexpr integral_constant span::partial<x, 0>{};
14
15 template <typename T>
16 struct nested {
17 template <typename U> static const U arr[3];
18 };
19 template <typename T>
20 struct nested<T*> {
21 template <typename U> static const U arr[3];
22 };
23 template <typename T> template <typename U> const U nested<T>::arr[3] = {};
24 template <typename T> template <typename U> const U nested<T*>::arr[3] = {};
25 template <typename T> template <typename U> const U nested<T*>::arr<U*>[3] = {};
26
27 export inline void format() {
28 span::__v<1>.f();
29 span::partial<5, 0>.f();
30 nested<int>::arr<integral_constant>[0].f();
31 nested<int*>::arr<integral_constant>[0].f();
32 nested<int*>::arr<integral_constant*>[0].f();
33 }