[Issue 4177] __ctfe can't be used in pure functions
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Jun 8 11:38:39 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4177
Don <clugdbug at yahoo.com.au> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch
CC| |clugdbug at yahoo.com.au
Version|future |2.041
--- Comment #1 from Don <clugdbug at yahoo.com.au> 2010-06-08 11:38:37 PDT ---
Since __ctfe is so magical and unique, it seems justified to give it one more
special case. Other approaches I tried (changing the storage_class of __ctfe)
were far more complicated.
PATCH expression.c, VarExp::semantic(), line 4397.
+ /* Magic variable __ctfe never violates pure or safe
+ */
+ if (v->ident == Id::ctfe)
+ return this;
/* If ANY of its enclosing functions are pure,
* it cannot do anything impure.
* If it is pure, it cannot access any mutable variables other
* than those inside itself
*/
--
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