From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EAD363858D39; Mon, 27 Feb 2023 19:56:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EAD363858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677527810; bh=4bNgeXYMyDUbSV76mL539ycyRGwd3Ycoquf2WhKwqYE=; h=From:To:Subject:Date:From; b=xVxD3uLQS0BcjzcfpV9yH7woauRKfc2AY3mqFDaciFOQoipwtPkImOnNhEjVlUdmL tmDO2Xml0W6ey9bEi8jKfVVX7YSEliEGwDNT/6flEvnBps7+AiwwsQz4CJEkiAyhZm aQ+T5mZGGepgHNJ1mOAzSttYTKxNIwqiDeCFlTCw= From: "piotr5 at netscape dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108955] New: Ultimate++ fails with its specialized AssertMoveable Date: Mon, 27 Feb 2023 19:56:50 +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: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: piotr5 at netscape dot net 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 attachments.created 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108955 Bug ID: 108955 Summary: Ultimate++ fails with its specialized AssertMoveable Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: piotr5 at netscape dot net Target Milestone: --- Created attachment 54548 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D54548&action=3Dedit my failed attempt at a minimal example after preprocessor I'm on gentoo with sys-devel/gcc-13.0.1_pre20230219 and tried to recompile anything using Ultimate++ from upp.sf.net and already the heaqders fail to compile. error: invalid type argument of unary '*' (have 'unsigned int') this indicates the pre-c++11 test for "unsigned int" being a moveable data-= type failed. I tried to reproduce the problem with a minimal example but that ha= d no such problems in compilation. the way it's supposed to work is Core/Topt.h: ``` template inline void AssertMoveablePtr(T, T) {} template inline void AssertMoveable0(T *t) { AssertMoveablePtr(&**t, *t); } // COMPILATION ERROR HERE MEANS TYPE T WAS NOT MARKED AS Moveable template struct Moveable_ { friend void AssertMoveable0(T *) {} }; template inline void AssertMoveable(T *t =3D 0) { if(t) AssertMoveable0(t); } #if defined(COMPILER_MSC) || defined(COMPILER_GCC) && (__GNUC__ < 4 || __GNUC_MINOR__ < 1) #define NTL_MOVEABLE(T) inline void AssertMoveable0(T *) {} #else #define NTL_MOVEABLE(T) template<> inline void AssertMoveable(T = *) {} #endif NTL_MOVEABLE(bool) NTL_MOVEABLE(char) NTL_MOVEABLE(signed char) NTL_MOVEABLE(unsigned char) NTL_MOVEABLE(short) NTL_MOVEABLE(unsigned short) NTL_MOVEABLE(int) NTL_MOVEABLE(unsigned int) NTL_MOVEABLE(long) NTL_MOVEABLE(unsigned long) NTL_MOVEABLE(int64) NTL_MOVEABLE(uint64) NTL_MOVEABLE(float) NTL_MOVEABLE(double) NTL_MOVEABLE(void *) NTL_MOVEABLE(const void *) ``` then in destructor for Vector there is AssertMoveable((T *)0); where T =3D unsigned int what is supposed to happen is that NTL_MOVEABLE expands to template<> inline void AssertMoveable(T *) {} so far it works as expected. however upon encontering that AssertMoveable((T *)0); it is expanded into inline void AssertMoveable0(T *t) { AssertMoveablePtr(&**t, *t); } instead. is it because that was defined in the wrong order? but then why di= d my minimal example work? why is there no such problem with gcc-12?=