From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 14ACD3857813; Thu, 7 Mar 2024 11:00:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 14ACD3857813 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709809205; bh=5KvBgg+Q091tKe04GahECmnQ7Z7Ysb3ml6YOodqf9Pk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=PnYqMbCPpi6izqnY+crUUWTZhGdM2f2aNGovzpCzuTKMyQAJE/2hiYBlc8K7+8mDI MyVeZPewcRJKQQu2EzIn23RF7So0zcWTqycJrHWAzcBjpgELTomebtl+cJVAT+W68v gCrKVseSw3vrGw4eZ5/iyxcmmeyCzU2xHeB2xVgI= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/98881] [modules] internal compiler error: in tpl_parms_fini, at cp/module.cc:9933 Date: Thu, 07 Mar 2024 11:00:04 +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: 11.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: nathan 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=3D98881 --- Comment #6 from GCC Commits --- The master branch has been updated by Nathaniel Shead : https://gcc.gnu.org/g:77772f8a3da8ea30066d2201f8148714a8e89da5 commit r14-9356-g77772f8a3da8ea30066d2201f8148714a8e89da5 Author: Nathaniel Shead Date: Tue Mar 5 15:17:09 2024 +1100 c++: Stream DECL_CONTEXT for template template parms [PR98881] When streaming in a nested template-template parameter as in the attached testcase, we end up reaching the containing template-template parameter in 'tpl_parms_fini'. We should not set the DECL_CONTEXT to this (nested) template-template parameter, as it should already be the struct that the outer template-template parameter is declared on. The precise logic for what DECL_CONTEXT should be for a template template parameter in various situations seems rather obscure. Rather than trying to determine the assumptions that need to hold, it seems simpler to just always re-stream the DECL_CONTEXT as needed for now. PR c++/98881 gcc/cp/ChangeLog: * module.cc (trees_out::tpl_parms_fini): Stream out DECL_CONTEXT for template template parameters. (trees_in::tpl_parms_fini): Read it. gcc/testsuite/ChangeLog: * g++.dg/modules/tpl-tpl-parm-3.h: New test. * g++.dg/modules/tpl-tpl-parm-3_a.H: New test. * g++.dg/modules/tpl-tpl-parm-3_b.C: New test. * g++.dg/modules/tpl-tpl-parm-3_c.C: New test. Signed-off-by: Nathaniel Shead Reviewed-by: Patrick Palka Reviewed-by: Jason Merrill =