Files
ldc/tests/mini
Christian Kamm 723cfef519 Another shot at fixing the issues with (constant) struct literals and their addresses. See DMD2682, #218, #324.
The idea is to separate the notion of const from 'this variable can always be
replaced with its initializer' in the frontend. To do that, I introduced
Declaration::isSameAsInitializer, which is overridden in VarDeclaration to
return false for constants that have a struct literal initializer.

So
{{{
const S s = S(5);
void foo() { auto ps = &s; }
// is no longer replaced by
void foo() { auto ps = &(S(5)); }
}}}

To make taking the address of a struct constant with a struct-initializer
outside of function scope possible, I made sure that AddrExp::optimize doesn't
try to run the argument's optimization with WANTinterpret - that'd again
replace the constant with a struct literal temporary.
2009-06-14 19:49:58 +02:00
..
2008-09-11 21:10:15 +02:00
2008-09-11 21:10:15 +02:00
2008-09-11 21:10:15 +02:00
2008-09-11 21:10:15 +02:00
2008-09-11 21:10:15 +02:00
2009-03-03 19:03:27 +01:00
2009-03-03 18:26:39 +01:00
2009-03-03 19:03:27 +01:00
2009-03-03 19:03:27 +01:00
2009-03-03 18:26:39 +01:00
2009-02-18 21:46:14 +01:00
2008-10-07 20:22:04 +02:00
2009-01-17 14:53:32 +01:00
2008-10-06 22:46:55 +02:00
2009-03-24 14:33:57 +01:00
2008-07-30 10:41:31 +02:00
2009-01-17 17:41:03 +01:00
2009-01-22 21:46:40 +01:00
2009-05-10 14:37:30 +02:00
2008-10-07 20:22:04 +02:00
2008-10-22 14:55:33 +02:00
2008-10-22 14:55:33 +02:00
2009-03-03 19:03:27 +01:00
2009-02-03 12:33:42 -07:00
2008-11-30 11:54:18 +01:00
2008-07-23 18:04:06 +02:00
2008-10-05 17:28:15 +02:00
2008-12-07 16:06:10 +01:00