From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6D0213858C62; Sun, 17 Mar 2024 09:02:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6D0213858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1710666165; bh=pc69GQuJ6CHSd1J6ocRfE35mKiH4952ZUZR8TdVLEZc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=H3Z6jzeVIKzT9bJ/fNP3gNRcNzcR1i8heuGmt/g4KZLOr48DhV87rBMMiIqWHfET2 bg0uny4VTFJaF/5Gnh6WxR3fHdz2GeU1H8TzJlwRPhlDQJ56dwQY6Tg8lXOTSY+wxN WliSnp1aMMJ1B4r0Sew1/i3qDivvmZYJmcA8PHAE= From: "nshead at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114275] using std::thread within a templated function in a module fails to compile Date: Sun, 17 Mar 2024 09:02:43 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.2.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: nshead at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114275 --- Comment #4 from Nathaniel Shead --- I suspect there are a number of issues tied together here. Some of the thin= gs I've discovered so far: - 'tsubst_friend_class' calls 'lookup_name', which when called from a module that doesn't export the class that was befriended fails to find it, and so = it substitutes in a new instance of that type (which then later fails duplicate_decls). - Instantiating an elaborated type specifier doesn't attach it to the module the containing template was declared in. - Sometimes it seems that the container of a MK_local_friend decl is not al= ways correctly streamed: in particular, in the comment 2 testcase the container streamed is a complete type on write, but on read is not complete (TYPE_SIZ= E is null) and so is not properly read on stream-in in the first place. Additionally, it looks like you can hide some of the errors by making the importer a named module, because on instantiation it only calls 'duplicate_decls' on names imported from a partition.=