Bug 7199 – std.string.indexof cannot be compiled with -inline
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-01-02T07:30:00Z
Last change time
2015-06-09T04:41:31Z
Keywords
rejects-valid
Assigned to
nobody
Creator
r.sagitario
Comments
Comment #0 by r.sagitario — 2012-01-02T07:30:11Z
With the latest version from github, this code fails to compile with "-inline":
module test;
import std.string;
int main()
{
string s = "abcd";
int index = indexOf(s, "b");
return index;
}
m:\s\d\rainers\phobos\std\algorithm.d(2970): Error: function std.string.indexOf!
(char,char).indexOf.simpleMindedFind!(__lambda6,const(char)[],const(char)[]).sim
pleMindedFind is a nested function and cannot be accessed from main
This works with dmd 2.057 or without -inline.
*** Issue 7339 has been marked as a duplicate of this issue. ***
Comment #3 by clugdbug — 2012-01-24T12:38:12Z
I've changed this to a Phobos bug, since it's a regression caused by a change in Phobos. The root cause DMD bug 4841 is not a regression.
Comment #4 by webby — 2012-01-27T15:19:56Z
If i try to build Juno with the latest DMD/Phobos as of now, i get
Error: function juno.locale.core.Culture.displayName cannot get frame pointer to simpleMindedFind
(Where displayName calls std.string.indexOf).
It builds ok without -inline.
Comment #5 by hoganmeier — 2012-01-27T15:55:48Z
Richard, yes, see my comment 1 for the reduced version.