From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BADB2385800A; Sun, 7 Feb 2021 23:20:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BADB2385800A From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/98992] New: attribute malloc error associating a member deallocator with an allocator Date: Sun, 07 Feb 2021 23:20:18 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: Sun, 07 Feb 2021 23:20:18 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98992 Bug ID: 98992 Summary: attribute malloc error associating a member deallocator with an allocator Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: msebor at gcc dot gnu.org Target Milestone: --- The new attribute malloc is rejected on declarations of member function: $ cat t.C && /build/gcc-master/gcc/xg++ -B /build/gcc-master/gcc -S -Wall t= .C struct A { void dealloc (void*); __attribute__ ((malloc (dealloc)))=20 void* alloc (); }; t.C:6:16: error: =E2=80=98malloc=E2=80=99 attribute argument 1 does not nam= e a function 6 | void* alloc (); | ^ The attribute handler is prepared for FUNCTION_DECL and OVERLOAD but not for how a member function is represented here: VOID align:1 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 0x7fffea9532a0 pointer_to_this reference_to_this > arg:0 context full-name "struct S" n_parents=3D0 use_template=3D0 interface-unknown pointer_to_this chain > arg:0 constant arg:0 constant>>> arg:1 QI size unit-size align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 0x7fffea96a690 method basetype arg-types chain chain >>>> functions used public private external decl_3 QI /build/tmp/t.C:8:8 align= :16 warn_if_not_align:0 context full-name "void S::m_dealloc(char*)" chain > binfo public private bases:0 offset > access_binfo > /build/tmp/t.C:9:27 start: /build/tmp/t.C:9:27 finish: /build/tmp/t.C:9= :35>=