From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9832D3847725; Thu, 4 Apr 2024 01:15:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9832D3847725 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712193350; bh=95Y1nK4/9achwy8mA0M/+cZywNzlyVDCJwWKLTS9Rw4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qh76+kxS7LlYBxIqLuRM4BAI/qxKzCP/mCNL4Lby29A2od1lgziJJolrHGGoRJOh1 7dwEpf5qwD4Zge5XYg1YHIAP9l/Tumf66rAO0yI7y3vgBanJy07ZkZDkFWkIDB42aQ oJ+6ponFaHrHtBuMZPMDv/aGRrf+qXCwyD4VG42o= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/25548] Rejects dependent destructor on a non dedendent name (for basic types) too late Date: Thu, 04 Apr 2024 01:15:49 +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: 4.2.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: minor X-Bugzilla-Who: pinskia 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: cf_known_to_fail keywords 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=3D25548 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Known to fail| | Keywords|accepts-invalid |rejects-valid --- Comment #2 from Andrew Pinski --- Hmm, EDG and MSVC accept the code for both GetChar having Foo and char as return types. Even accepts this and runs correctly: ``` class Foo {}; Foo a; struct Bing { Foo *GetChar(){return &a;} }; template struct Bar { void Wibble() { bing.GetChar()->~T(); // How can this be legal if T isn't char? } Bing bing; }; int main(){Bar a;a.Wibble();} ``` Also Clang has the same error message as GCC here (for `Foo*` return type only). I am not sure if there is not a defect report in this area even.=