From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26900 invoked by alias); 12 Aug 2010 18:39:10 -0000 Received: (qmail 26812 invoked by uid 48); 12 Aug 2010 18:38:53 -0000 Date: Thu, 12 Aug 2010 18:39:00 -0000 Message-ID: <20100812183853.26811.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/45265] GCC has an intermittent bug when computing the address of function parameters In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rogerio at rilhas 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: 2010-08/txt/msg01037.txt.bz2 ------- Comment #32 from rogerio at rilhas dot com 2010-08-12 18:38 ------- (In reply to comment #30) > >you can't even begin to understand how to make a temporary variable an l-value. > Please look up "move constructors" and rvalue references. "move constructors" > are not standard C++ code but the C++ standard committee decided to add rvalue > references instead. Please read the history of those and then come back when > you understand what you are talking about. If I were to follow your logic I would, because acording to your logic a parameter doesn't have an address. But C99 doesn't limit this in any way, does it? The & get the address of the item, period. So I don't need to go look up unrelated topics, you are the one who should look up address of parameter. function(class_name(initializer)) ... should work if class_name(initializer) were an lvalue. One of you posted a standard for that. Microsoft can get the address of class_name(initializer), hence Microsft is capable of looking at class_name(initializer) as an l-value. How Microsoft does it is not important, they do it and GCC doesn't. So Microsoft can compile all these equivalently: int a=10; function(i) function(int(20)) function(class_name(initializer)) I don't really care what GCC could do to make class_name(initializer) an l-value, but if "move constructors" are a good way to go at it then do it. As C99 doesn't specify this GCC is happy and doesn't need the feel to change. And, so, I don't call it a bug, just a very nice feature that it is missing. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45265