https://gcc.gnu.org/g:d23698b29b9fea667aa6b24bede83ccffd9adeab
commit r17-3032-gd23698b29b9fea667aa6b24bede83ccffd9adeab Author: Jakub Jelinek <[email protected]> Date: Thu Aug 6 13:27:02 2026 +0200 testsuite: Handle C++29 in libstdc++ std module exports plugin Similar thing to the last, we also want to verify std.cc module exports in C++29 mode. 2026-08-06 Jakub Jelinek <[email protected]> * g++.dg/plugin/plugin.exp (plugin_test_list): Add std-module-exports-c++29.C. * g++.dg/plugin/std_module_exports_plugin.cc (whitelist_std): Add cxx29 enumerator, change value of all. (plugin_dump_decl): Handle C++29. * g++.dg/plugin/std-module-exports-c++29.C: New test. Diff: --- gcc/testsuite/g++.dg/plugin/plugin.exp | 3 ++- gcc/testsuite/g++.dg/plugin/std-module-exports-c++29.C | 11 +++++++++++ gcc/testsuite/g++.dg/plugin/std_module_exports_plugin.cc | 5 ++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/g++.dg/plugin/plugin.exp b/gcc/testsuite/g++.dg/plugin/plugin.exp index 52147811385c..440d1838b913 100644 --- a/gcc/testsuite/g++.dg/plugin/plugin.exp +++ b/gcc/testsuite/g++.dg/plugin/plugin.exp @@ -93,7 +93,8 @@ set plugin_test_list [list \ { std_module_exports_plugin.cc \ std-module-exports-c++20.C \ std-module-exports-c++23.C \ - std-module-exports-c++26.C } \ + std-module-exports-c++26.C \ + std-module-exports-c++29.C } \ { comment_plugin.cc comments-1.C } \ ] diff --git a/gcc/testsuite/g++.dg/plugin/std-module-exports-c++29.C b/gcc/testsuite/g++.dg/plugin/std-module-exports-c++29.C new file mode 100644 index 000000000000..79fa998b9c76 --- /dev/null +++ b/gcc/testsuite/g++.dg/plugin/std-module-exports-c++29.C @@ -0,0 +1,11 @@ +// Test bits/std.cc exports everything it should. +// This is done using a plugin to walk std namespace and +// its child namespaces, looking for decls with non-uglified +// names which aren't deprecated and are not exported. +// { dg-do link } +// { dg-options "-O0 -std=c++29 -fmodules -freflection -x c++-system-module bits/std.cc -x none" } + +int +main () +{ +} diff --git a/gcc/testsuite/g++.dg/plugin/std_module_exports_plugin.cc b/gcc/testsuite/g++.dg/plugin/std_module_exports_plugin.cc index 21a765041f6e..9487b093a186 100644 --- a/gcc/testsuite/g++.dg/plugin/std_module_exports_plugin.cc +++ b/gcc/testsuite/g++.dg/plugin/std_module_exports_plugin.cc @@ -19,7 +19,8 @@ enum class whitelist_std { cxx20 = 1 << 0, cxx23 = 1 << 1, cxx26 = 1 << 2, - all = (1 << 3) - 1 + cxx29 = 1 << 3, + all = (1 << 4) - 1 }; struct { const char *name; @@ -98,6 +99,8 @@ plugin_dump_decl (tree decl, char *scope, hash_set<tree> **exported_usings) this_std = whitelist_std::cxx23; else if (cxx_dialect == cxx26) this_std = whitelist_std::cxx26; + else if (cxx_dialect == cxx29) + this_std = whitelist_std::cxx29; for (int i = 0; i < ARRAY_SIZE (whitelist); ++i) if (strncmp (whitelist[i].name, scope, scope_len) == 0 && strcmp (whitelist[i].name + scope_len,
