Bug 13187 – Function wrongly deduced as pure

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-07-22T15:19:00Z
Last change time
2014-08-22T08:05:20Z
Keywords
accepts-invalid, pull
Assigned to
nobody
Creator
schuetzm

Comments

Comment #0 by schuetzm — 2014-07-22T15:19:22Z
This compiles: int function(int) pure my_func_ptr; struct WronglyPure { static opDispatch(string fn, Args...)(Args args) { return mixin(fn)(args); } } int test() pure { return WronglyPure.my_func_ptr(1); } Evidently, `opDispatch` is deduced as pure, but it shouldn't be, because it access the global variable `my_func_ptr`.
Comment #1 by k.hara.pg — 2014-08-10T12:44:57Z
Comment #2 by k.hara.pg — 2014-08-10T12:45:29Z
Comment #3 by github-bugzilla — 2014-08-10T13:48:02Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/184a52f0d9c00b06d451426198c892ff50bb7099 fix Issue 13187 - Function wrongly deduced as pure https://github.com/D-Programming-Language/dmd/commit/125f5e9341730fd09d4ab83c1de33742435dab20 Merge pull request #3864 from 9rnsr/fix13187 [REG2.066a] Issue 13187 - Function wrongly deduced as pure
Comment #4 by github-bugzilla — 2014-08-10T15:03:54Z
Commit pushed to 2.066 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/6a9ef9a5c798428845f0437884eaf92d3c7a80e6 Merge pull request #3864 from 9rnsr/fix13187 [REG2.066a] Issue 13187 - Function wrongly deduced as pure
Comment #5 by github-bugzilla — 2014-08-22T08:05:20Z