From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by sourceware.org (Postfix) with ESMTPS id 7F8E63858C50 for ; Sat, 16 Dec 2023 10:31:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7F8E63858C50 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7F8E63858C50 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::102c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702722670; cv=none; b=Yv73/VmJndE/N4SRKss68yrS5YnSfCLZmJXiqOFRDBe5badRKENNI5n5Kpq79b0IpcTjKD6pXl6v9wHyx8UqWZh/6N5kEmHeD8d7rHVb5Wfgc9kVg+we9Nvn47hY/1B1SLR6WQovfyS1qM46cOgPaTYvxosXXfE87hZT7LCgMoA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702722670; c=relaxed/simple; bh=QdmCJE3q84khOJKlaOCt2CQRU3Fj+Nf7XOnHkcAKu4M=; h=DKIM-Signature:Message-ID:Date:From:To:Subject:MIME-Version; b=HAhH5StimvGvkbttlvqrMcvpGFJH3aYmgjBFQvhctqMihswnO1oYA+pAKbxEl2A4qk4yR7OKQWbkAYWu5XApePne/EMvA2+BCMYQZok5WmHSfV1iEuc0gW9rYuxzcf6lygzPTAi9XPFZNuj0TVL7U7xal7UUGESJpmApZZjzjqw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-286b45c5a8dso1261137a91.1 for ; Sat, 16 Dec 2023 02:31:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702722667; x=1703327467; darn=gcc.gnu.org; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=ZXgiQHGhIYGZV6UDuYbnpPz8g7x7r+S3srDuwnM3O5w=; b=HmkQbi4mq3F5FAx6GaWdleUKV/lILc+C7DRW21mD5eRBHh2+n4Xnigf7JmIdiXGdWp 4QUVsQLBKul89W8ww3VRernmbe5Y8LRvm85vRO6D/5F7zWEz8I8APZuvi1MxtC96Fl60 JEIIJGlh2bK3FJq4ved6x1YTvqDsMvvgjsnwcs29tmKIRstQqg4ADRhZqO8pUCJRaFed 5Vs79wM3BfO6arVMMaWEqDz74OIHzasxwVT3bAZmHeRQO/k8N0cFa+r3FZ9dhM6WSjEJ /4XmvFt5qpGaERn83MD15siUg9yjH45WjSp/heTUGULDjjtJJoquprNRgmQXv2+ogIHY 9ziA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702722667; x=1703327467; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ZXgiQHGhIYGZV6UDuYbnpPz8g7x7r+S3srDuwnM3O5w=; b=wGAGLr+phZephBUOZ1Z06mCzqekB2B4qLfpBxL6EP2qKllkMPdcNcigejH6710o5zp xZ+YK+oQS7JL5Qge9WQ3l1h4KJ+IWB9ADaXwad/KqWiWHXedqWrC4x9g/F1dHJa1TkF0 sFxl0iSxC1ekuLeLCDpKaiCdxAtNnGxHuaSAJPX/Q+xAk2DHRKgBo5XZtQlFajiwJhH9 +0kDzOZTbGRJNlyMUOh1+ks4y9qItG21KaLfz+HYuMOmjy2mVmQx/0Xfo7yN690hZJ9s KC72RJrj3YA/lV15iaJSB+6VhJG5E+G7gjpktQU0D5RhV6yep9L/srGLg2gYKzEJfDjj M7VA== X-Gm-Message-State: AOJu0YzBZWFvrzZge2y4Se6n4RKSda+7+D5LCkQmjw2InupSR+GYtttQ Vgixg2eoNnLiIdKcKaqXBn2mrTPJLjc= X-Google-Smtp-Source: AGHT+IFxTRtYDvfMIbx/ilP8+LQM0eTkzEEfgHfNEr6IEF+qogAEA7Gb6N91kClyPE93CJpBGwK9SQ== X-Received: by 2002:a05:6a20:3b23:b0:18f:c18d:1831 with SMTP id c35-20020a056a203b2300b0018fc18d1831mr12269476pzh.109.1702722666799; Sat, 16 Dec 2023 02:31:06 -0800 (PST) Received: from Thaum. ([203.166.236.30]) by smtp.gmail.com with ESMTPSA id n56-20020a056a000d7800b006ce75e0ef83sm15477069pfv.179.2023.12.16.02.31.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 02:31:06 -0800 (PST) Message-ID: <657d7c6a.050a0220.5ef1f.0938@mx.google.com> X-Google-Original-Message-ID: Date: Sat, 16 Dec 2023 21:31:01 +1100 From: Nathaniel Shead To: gcc-patches@gcc.gnu.org Cc: Jason Merrill , Nathan Sidwell Subject: Re: [PATCH] c++/modules: seed namespaces for bindings [PR106363] References: <6550318c.170a0220.caf0c.3fe5@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6550318c.170a0220.caf0c.3fe5@mx.google.com> X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE,URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Ping for https://gcc.gnu.org/pipermail/gcc-patches/2023-November/636159.html On Sun, Nov 12, 2023 at 12:59:36PM +1100, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu. I don't have write > access. > > -- >8 -- > > Currently the first depset for an EK_BINDING is not seeded. This breaks > the attached testcase as then the namespace is not considered referenced > yet during streaming, but we've already finished importing. > > There doesn't seem to be any particular reason I could find for skipping > the first depset for bindings, and removing the condition doesn't appear > to cause any test failures, so this patch removes that check. > > PR c++/106363 > > gcc/cp/ChangeLog: > > * module.cc (module_state::write_cluster): Don't skip first > depset for bindings. > > gcc/testsuite/ChangeLog: > > * g++.dg/modules/pr106363_a.C: New test. > * g++.dg/modules/pr106363_b.C: New test. > > Signed-off-by: Nathaniel Shead > --- > gcc/cp/module.cc | 4 +--- > gcc/testsuite/g++.dg/modules/pr106363_a.C | 9 +++++++++ > gcc/testsuite/g++.dg/modules/pr106363_b.C | 10 ++++++++++ > 3 files changed, 20 insertions(+), 3 deletions(-) > create mode 100644 gcc/testsuite/g++.dg/modules/pr106363_a.C > create mode 100644 gcc/testsuite/g++.dg/modules/pr106363_b.C > > diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc > index c1c8c226bc1..411a3b9411c 100644 > --- a/gcc/cp/module.cc > +++ b/gcc/cp/module.cc > @@ -14741,9 +14741,7 @@ module_state::write_cluster (elf_out *to, depset *scc[], unsigned size, > for (unsigned ix = 0; ix != size; ix++) > { > depset *b = scc[ix]; > - for (unsigned jx = (b->get_entity_kind () == depset::EK_BINDING > - || b->is_special ()) ? 1 : 0; > - jx != b->deps.length (); jx++) > + for (unsigned jx = b->is_special (); jx != b->deps.length (); jx++) > { > depset *dep = b->deps[jx]; > > diff --git a/gcc/testsuite/g++.dg/modules/pr106363_a.C b/gcc/testsuite/g++.dg/modules/pr106363_a.C > new file mode 100644 > index 00000000000..c18d2eef1c8 > --- /dev/null > +++ b/gcc/testsuite/g++.dg/modules/pr106363_a.C > @@ -0,0 +1,9 @@ > +// PR c++/106363 > +// { dg-additional-options "-fmodules-ts" } > +// { dg-module-cmi pr106363.a } > + > +export module pr106363.a; > + > +namespace ns { > + export int x; > +} > diff --git a/gcc/testsuite/g++.dg/modules/pr106363_b.C b/gcc/testsuite/g++.dg/modules/pr106363_b.C > new file mode 100644 > index 00000000000..0508c0d6193 > --- /dev/null > +++ b/gcc/testsuite/g++.dg/modules/pr106363_b.C > @@ -0,0 +1,10 @@ > +// PR c++/106363 > +// { dg-additional-options "-fmodules-ts" } > +// { dg-module-cmi pr106363.b } > + > +export module pr106363.b; > +import pr106363.a; > + > +namespace ns { > + export using ns::x; > +} > -- > 2.42.0 >