From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12869 invoked by alias); 6 May 2009 05:25:21 -0000 Received: (qmail 12766 invoked by uid 48); 6 May 2009 05:25:07 -0000 Date: Wed, 06 May 2009 05:25:00 -0000 Message-ID: <20090506052507.12765.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/40036] Initializer incorrectly reordering arguments In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jwbates at mac dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-05/txt/msg00400.txt.bz2 ------- Comment #3 from jwbates at mac dot com 2009-05-06 05:25 ------- Not sure at all, as I have very little experience dealing with this kind of issue. To clarify one point of ambiguity: when I mentioned swapping the order of the arguments to match the correct evaluation behaviour. So, my constructor Expression(lhs, rhs) calls the initializer _potential(rhs, lhs), which is correct for my math. However, that's not the problem that I'm seeing. When I set the breakpoint at Expression(lhs, rhs) and check the locations, lhs is at 0x######6c, and rhs is at 0x######00 (or some such). When I step into _potential(p, other), I should expect p to be rhs and other to be lhs, so _potential(0x######00, 0x######6c), but what I see is _potential(0x######6c, 0x######00), which is pretty unambiguously incorrect. I'm perfectly willing to believe that my code is wrong, but I don't understand what kind of code I could write (or fail to write) that could lead to a direct call to an initializer with the argument addresses (but not the argument types) swapped. If there's any place else that I can look, or any potential workarounds I can try, I'll be happy to. It just looks, feels, and quacks like a bug to me. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40036