testsuite: C++ module tests
[gcc.git] / gcc / testsuite / g++.dg / modules / adl-4_b.C
1 // { dg-additional-options -fmodules-ts }
2
3 import inter;
4
5 namespace hidden
6 {
7
8 struct Y
9 {
10
11 int m;
12 Y (int m) : m(m)
13 {
14 }
15
16 operator int () const
17 {
18 return m;
19 }
20 };
21
22 }
23
24 int main ()
25 {
26 hidden::Y y(2);
27
28 // unexported hidden::fn@inter is not visible from TPL@inter
29 if (TPL (y) != -2)
30 return 2;
31
32 return 0;
33 }
34
35 // ADL fails
36 // { dg-regexp {[^\n]*/adl-4_a.C:14:[0-9]*: error: 'fn' was not declared in this scope\n} }