From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1888) id 8D7953858D38; Tue, 20 Sep 2022 14:21:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8D7953858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663683679; bh=16nIdCsapishRxMpIkUo7jdLoH6kSQZozkI9FcRzdF8=; h=From:To:Subject:Date:From; b=Z6FnT7ZLJaDRVGRwsbnSqDJejBO9PzS90wDeOBS7yIKQGjmg+7WNzLOTo3OAM3MnR O9WZWuCfJB50v7aop7ctYZOZ6PNrOI4mGVlks/IDYgW6u8pTwDyrnPwLkATMQHYI3I eVaIxLNRCW30s6xaPJeL8pIRPJezbGOSfeN9SEHU= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Patrick Palka To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-2735] c++: stream PACK_EXPANSION_EXTRA_ARGS [PR106761] X-Act-Checkin: gcc X-Git-Author: Patrick Palka X-Git-Refname: refs/heads/master X-Git-Oldrev: a8bb495a5627bba44407dedbe38653bb0432d811 X-Git-Newrev: 84b2ab97e412d9514730db335a795c7db2fb42cc Message-Id: <20220920142119.8D7953858D38@sourceware.org> Date: Tue, 20 Sep 2022 14:21:19 +0000 (GMT) List-Id: https://gcc.gnu.org/g:84b2ab97e412d9514730db335a795c7db2fb42cc commit r13-2735-g84b2ab97e412d9514730db335a795c7db2fb42cc Author: Patrick Palka Date: Tue Sep 20 10:19:30 2022 -0400 c++: stream PACK_EXPANSION_EXTRA_ARGS [PR106761] 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) : Stream PACK_EXPANSION_EXTRA_ARGS. (trees_in::tree_node) : 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. Diff: --- gcc/cp/module.cc | 3 +++ gcc/testsuite/g++.dg/modules/pr106761.h | 22 ++++++++++++++++++++++ gcc/testsuite/g++.dg/modules/pr106761_a.H | 5 +++++ gcc/testsuite/g++.dg/modules/pr106761_b.C | 7 +++++++ 4 files changed, 37 insertions(+) diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc index 1a1ff5be574..9a9ef4e3332 100644 --- a/gcc/cp/module.cc +++ b/gcc/cp/module.cc @@ -8922,6 +8922,7 @@ trees_out::type_node (tree type) 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: @@ -9455,12 +9456,14 @@ trees_in::tree_node (bool is_use) { 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; } diff --git a/gcc/testsuite/g++.dg/modules/pr106761.h b/gcc/testsuite/g++.dg/modules/pr106761.h new file mode 100644 index 00000000000..9f22a22a45d --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr106761.h @@ -0,0 +1,22 @@ +// PR c++/106761 + +template +struct __and_; + +template +struct is_convertible; + +template +struct _TupleConstraints { + template + using __constructible = __and_...>; +}; + +template +struct tuple { + template + using __constructible + = typename _TupleConstraints::template __constructible; +}; + +tuple t; diff --git a/gcc/testsuite/g++.dg/modules/pr106761_a.H b/gcc/testsuite/g++.dg/modules/pr106761_a.H new file mode 100644 index 00000000000..8ad116412af --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr106761_a.H @@ -0,0 +1,5 @@ +// PR c++/106761 +// { dg-additional-options -fmodule-header } + +// { dg-module-cmi {} } +#include "pr106761.h" diff --git a/gcc/testsuite/g++.dg/modules/pr106761_b.C b/gcc/testsuite/g++.dg/modules/pr106761_b.C new file mode 100644 index 00000000000..418991b1874 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr106761_b.C @@ -0,0 +1,7 @@ +// PR c++/106761 +// { dg-additional-options -fmodules-ts } + +#include "pr106761.h" +import "pr106761_a.H"; + +tuple u = t;