From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4683C3858D37; Wed, 1 Feb 2023 20:21:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4683C3858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675282864; bh=uj0ZOXvtAuEZ8PV/KahFOxCr8BUie8+ypN/NziKhwVU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LrRHrNxvPMWK98up/9xPNYubkyqdsoTxZ32nuau/IgpfUBDh9Dvi96E1D9Op1eFKH wMkFKdMuTyE/wAH3tf9tdcRrQaZCI3Xboct8jVbRx/nRSPAkQ+JK2lo+N2qLv3fHbb 5H5QGERBZiJLEykbJcQe+w08zVhha0qpv4O0fBXU= From: "jason at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/69836] compilation error with constexpr in template types with redeclared methods Date: Wed, 01 Feb 2023 20:21:03 +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: unknown X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: jason at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status everconfirmed cc cf_reconfirmed_on 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=3D69836 Jason Merrill changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 CC| |jason at gcc dot gnu.org Last reconfirmed| |2023-02-01 --- Comment #4 from Jason Merrill --- (In reply to Andrew Pinski from comment #3) > (In reply to Andrew Pinski from comment #2) > > I wonder if this is just invalid code but no diagnostic required as sta= te > > changes inside the scope of TemplateObject. >=20 > That is it needs to be reinterpret it after the parsing and needs to same > inside the scope itself. Like types of the same name should stay the same= if > used inside the class. I have not considered that rule to apply to additional overloads. Here, the problem looks to be that we're re-calculating the type of w_counter inside = the function definition (where the current function is in the overload set) rat= her than using the actual parameter type (which is calculated before the current function is in the overload set).=