[Issue 5889] Struct literal/construction should be rvalue

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jun 30 04:52:52 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5889



--- Comment #11 from Kenji Hara <k.hara.pg at gmail.com> 2011-06-30 04:47:55 PDT ---
Another example.
In C++0x (gcc-4.5.1), following code prints "1".
It seems to me that the S() makes rvalue instead of lvalue.
----
#include <stdio.h>

struct S {};

int f(S&&){ return 1; }
int f(const S&){ return 2; }

int main()
{
  printf("%d\n", f(S()));
  return 0;
}
----

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list