It looks like after the libstdc++ commit
r13-2158-g02f6b405f0e9dc
some xtreme-header-* tests are failing with "conflicting global module
declaration" errors ultimately because we're neglecting to stream
PACK_EXPANSION_EXTRA_ARGS, which leads to wrong equivalences of
different partial instantiations of _TupleConstraints::__constructible.
PR c++/106761
gcc/cp/ChangeLog:
* module.cc (trees_out::type_node) <case TYPE_PACK_EXPANSION>:
Stream PACK_EXPANSION_EXTRA_ARGS.
(trees_in::tree_node) <case TYPE_PACK_EXPANSION>: Likewise.
gcc/testsuite/ChangeLog:
* g++.dg/modules/pr106761.h: New test.
* g++.dg/modules/pr106761_a.H: New test.
* g++.dg/modules/pr106761_b.C: New test.
if (streaming_p ())
u (PACK_EXPANSION_LOCAL_P (type));
tree_node (PACK_EXPANSION_PARAMETER_PACKS (type));
+ tree_node (PACK_EXPANSION_EXTRA_ARGS (type));
break;
case TYPENAME_TYPE:
{
bool local = u ();
tree param_packs = tree_node ();
+ tree extra_args = tree_node ();
if (!get_overrun ())
{
tree expn = cxx_make_type (TYPE_PACK_EXPANSION);
SET_TYPE_STRUCTURAL_EQUALITY (expn);
PACK_EXPANSION_PATTERN (expn) = res;
PACK_EXPANSION_PARAMETER_PACKS (expn) = param_packs;
+ PACK_EXPANSION_EXTRA_ARGS (expn) = extra_args;
PACK_EXPANSION_LOCAL_P (expn) = local;
res = expn;
}
--- /dev/null
+// PR c++/106761
+
+template<class...>
+struct __and_;
+
+template<class, class>
+struct is_convertible;
+
+template<class... Ts>
+struct _TupleConstraints {
+ template<class... Us>
+ using __constructible = __and_<is_convertible<Ts, Us>...>;
+};
+
+template<class... Ts>
+struct tuple {
+ template<class... Us>
+ using __constructible
+ = typename _TupleConstraints<Ts...>::template __constructible<Us...>;
+};
+
+tuple<int, int> t;
--- /dev/null
+// PR c++/106761
+// { dg-additional-options -fmodule-header }
+
+// { dg-module-cmi {} }
+#include "pr106761.h"
--- /dev/null
+// PR c++/106761
+// { dg-additional-options -fmodules-ts }
+
+#include "pr106761.h"
+import "pr106761_a.H";
+
+tuple<int, int> u = t;