// { dg-additional-options "-fmodules-ts -Wtemplate-names-tu-local" } // Test streaming and instantiations of various kinds of exposures export module M; namespace { int x; constexpr int y = 1; struct S { int m; void d(); }; enum class E { e }; template int f(T t) { return (int)t; } } template void g() {} template int expose_1() { // { dg-warning "TU-local" } return x; } template void expose_2() { // { dg-warning "TU-local" } T t = &y; } template bool expose_3() { // { dg-warning "TU-local" } return !(T{} * (x + 5) > 123); } template bool expose_4() { // { dg-warning "TU-local" } return __is_same(S, T); } template void expose_5() { // { dg-warning "TU-local" } static_assert(T{} == (int)E::e); } template void expose_6() { // { dg-warning "TU-local" } f(T{}); } template void expose_7() { // { dg-warning "TU-local" } g<&y>(); } template void expose_8() { // { dg-warning "TU-local" } decltype(T{} .* &S::m)* (*x)[5][10]; }; template bool expose_9() { // { dg-warning "TU-local" } return noexcept((T{} .* &S::d)()); } template void expose_10() { // { dg-warning "TU-local" } using U = decltype(f()); } template void expose_11() { // { dg-warning "TU-local" } static thread_local E r; } template int expose_var // { dg-warning "TU-local" } = f(sizeof(T));