From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D6EE5398749F; Wed, 16 Sep 2020 19:22:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D6EE5398749F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1600284121; bh=FHiuR9XGwOUXODlSn2quYwOPhCMHjjYYUbWAp6ToPNA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=bNWGSypCv30eNoDoYheSiitaeCNPHDUg9qkEUkh8lFP5JXShZqpabue0Kg+7CNOFX TwbNm5ozKtvEl6rQxfMwOQ0CWvuEUlSFGvgafTQuYPpM5+TO/mcniM/2o6lVrppcVY Wl1kvc/uPSSoZrqwStokuxnDp2VQFs/+bqkkZuHo= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/94951] [8/9 Regression] dereferencing type-punned pointer will break strict-aliasing rules when using super class for a template type Date: Wed, 16 Sep 2020 19:22:01 +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: 9.3.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 8.5 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 19:22:01 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94951 --- Comment #9 from CVS Commits --- The releases/gcc-9 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:eca1dbea010ba4c18ccec90bacbad5d8ec72c09f commit r9-8897-geca1dbea010ba4c18ccec90bacbad5d8ec72c09f Author: Jakub Jelinek Date: Wed May 6 23:38:13 2020 +0200 c++: Avoid strict_aliasing_warning on dependent types or expressions [PR94951] The following testcase gets a bogus warning during build_base_path, when cp_build_indirect_ref* calls strict_aliasing_warning with a depend= ent expression. IMHO calling get_alias_set etc. on dependent types feels w= rong to me, we should just defer the warnings in those cases until instantia= tion and only handle the cases where neither type nor expr are dependent. 2020-05-06 Jakub Jelinek PR c++/94951 * typeck.c (cp_strict_aliasing_warning): New function. (cp_build_indirect_ref_1, build_reinterpret_cast_1): Use it instead of strict_aliasing_warning. * g++.dg/warn/Wstrict-aliasing-bogus-tmpl.C: New test. (cherry picked from commit d82414ebcf7716ea24688510594a2c464a105908)=