gcc/testsuite/g++.dg/modules/block-decl-2.C
raw| 1 | // { dg-additional-options "-fmodules-ts" } |
| 2 | // { dg-module-cmi !mod } |
| 3 | |
| 4 | export module mod; |
| 5 | |
| 6 | namespace { |
| 7 | void internal() {} |
| 8 | } |
| 9 | |
| 10 | export extern "C++" auto foo() { |
| 11 | struct X { |
| 12 | // `foo` is not attached to a named module, and as such |
| 13 | // `X::f` should be implicitly `inline` here |
| 14 | void f() { // { dg-error "exposes TU-local entity" } |
| 15 | internal(); |
| 16 | } |
| 17 | }; |
| 18 | return X{}; |
| 19 | } |