Debian Codegraph @

gcc/testsuite/g++.dg/modules/block-decl-3.h

raw
1 // GMF
2
3 // Non-inline function definitions in headers are a recipe for ODR violations,
4 // but we should probably support that anyway as its not inherently wrong
5 // if only ever included into the GMF of a single module.
6
7 auto gmf_n_i() {
8 struct X { void f() {} };
9 return X{};
10 }
11
12 inline auto gmf_i_i() {
13 struct X { void f() {} };
14 return X{};
15 }
16
17 auto gmf_n_i_i() {
18 struct X {
19 auto f() {
20 struct Y {
21 void g() {}
22 };
23 return Y{};
24 }
25 };
26 return X{};
27 }
28
29 inline auto gmf_i_i_i() {
30 struct X {
31 auto f() {
32 struct Y {
33 void g() {}
34 };
35 return Y{};
36 }
37 };
38 return X{};
39 }