[Issue 11920] New: Rvalue aggregate contains lvalues
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jan 13 11:45:04 PST 2014
https://d.puremagic.com/issues/show_bug.cgi?id=11920
Summary: Rvalue aggregate contains lvalues
Product: D
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Keywords: accepts-invalid
Severity: critical
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: monarchdodra at gmail.com
--- Comment #0 from monarchdodra at gmail.com 2014-01-13 11:44:59 PST ---
//----
struct S{int i;}
S foo();
void main()
{
foo().i = 5;
int* p = &foo().i;
}
//----
The above compiles just fine. However, (AFAIK) it is an error: The members of
an rvalue should themselves be rvalues. (or would that be an ER?)
I think both the examples above should be rejected.
It has sparked bugs such as:
http://d.puremagic.com/issues/show_bug.cgi?id=11889
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list