From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2D83D385840E; Fri, 20 Oct 2023 20:25:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2D83D385840E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1697833510; bh=UxRp0UPDfVREMIAT9RZ5oWsGIrbFtE+3Mvy1IiZXPGI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=igPKNMQMp4Bnn9zkzng969o0DEBSjWk9499Gfl7IwS4AtzpfjzHEu3fnMVsmLpe1L Y5coYQmLRL6rZh3+dO4mkPEqWtq3tDhpaspUhpQ+1yEg6Fhz/ee+IVZFV8HXdAe3nN hDaO/8wb6RJU889YX36273HJbUGwam+1epOQ5II0= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105322] [modules] ICE with constexpr object of local class type from another function Date: Fri, 20 Oct 2023 20:25:09 +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: 12.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: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.3 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=3D105322 --- Comment #6 from CVS Commits --- The master branch has been updated by Nathan Sidwell : https://gcc.gnu.org/g:084addf8a700fab9222d4127ab8524920d0ca481 commit r14-4806-g084addf8a700fab9222d4127ab8524920d0ca481 Author: Nathan Sidwell Date: Fri Oct 20 12:20:37 2023 -0400 c++: Constructor streaming [PR105322] An expresion node's type is streamed after the expression's operands, because the type can come from some aspect of an operand (for instance decltype and noexcept). There's a comment in the code explaining that. But that doesn't work for constructors, which can directly reference components of their type (eg FIELD_DECLS). If this is a type-introducing CONSTRUCTOR, we need to ensure the type has been streamed first. So move CONSTRUCTOR stream to after the type streaming. The reason things like COMPONENT_REF work is that they stream their first operand first, and that introduces the type that their second operand looks up a field in. gcc/cp/ PR c++/105322 * module.cc (trees_out::core_vals): Stream CONSTRUCTOR operands after the type. (trees_in::core_vals): Likewise. gcc/testsuite/ * g++.dg/modules/decltype-1_a.C: New. * g++.dg/modules/decltype-1_b.C: New. * g++.dg/modules/lambda-5_a.C: New. * g++.dg/modules/lambda-5_b.C: New.=