From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2AEC43858D37; Thu, 27 Apr 2023 20:14:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2AEC43858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682626496; bh=4qW+iJDXf3PYPWb36LsprGzW7x3zNcFPM02KxzYEmGc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=kp1/VUO54cwFcNWp6+xaBZOwcBdu9Q935KxpyJixf+rmWFUgZEAyq2VBMspdvZQAW FwAX79DvwhpuWKzRkarc3dqnKORQfLjoyhMqIYiby7YlJVwWoxpwFKaJVr9bioNha6 +8V1NkfpnysbXYb/5FaC/aQc3XyMuJLeQwMqoK74= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109654] unnecessary "cannot bind packed field to reference" error when referenced type has aligned(1) attribute Date: Thu, 27 Apr 2023 20:14:56 +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: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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 see_also resolution 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=3D109654 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=3D36566 Resolution|--- |INVALID --- Comment #1 from Andrew Pinski --- This won't work for templates or function overloading since GCC does NOT ma= ngle the alignment. This is why it was started to be rejected in the first place. That is: ``` typedef __attribute__((aligned(1))) int packed_int; template T load(T &a); int load1(int *a) { return load(*a); } int load2(int *a) { return load(*a); } ``` Will both still call load in both cases.=