www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7199] New: std.string.indexof cannot be compiled with -inline

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7199

           Summary: std.string.indexof cannot be compiled with -inline
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: r.sagitario gmx.de



PST ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 02 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7199


Jesse Phillips <Jesse.K.Phillips+D gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Jesse.K.Phillips+D gmail.co
                   |                            |m
   Target Milestone|---                         |2.059


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 19 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7199


Trass3r <mrmocool gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mrmocool gmx.de
           Platform|Other                       |All
         OS/Version|Windows                     |All



I posted a reduced version to
http://d.puremagic.com/issues/show_bug.cgi?id=4841#c2 cause I thought they were
the same.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 20 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7199


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dsimcha yahoo.com



*** Issue 7339 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 24 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7199


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug yahoo.com.au
          Component|DMD                         |Phobos



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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 24 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7199


Richard Webb <webby beardmouse.org.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |webby beardmouse.org.uk



PST ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 27 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7199




Richard, yes, see my comment 1 for the reduced version.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 27 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7199


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com



12:36:22 PST ---
This is not a duplicate of bug 4841.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 05 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7199




12:38:07 PST ---
Trass3r's example fails:

R1 find(alias pred = "a == b", R1, R2)(R1 haystack, R2 needle)
{
        return simpleMindedFind!pred(haystack, needle);
}
R1 simpleMindedFind(alias pred, R1, R2)(R1 haystack, R2 needle)
{
    bool haystackTooShort()
    {
            return true;
    }

    return haystack;
}

sizediff_t indexOf(Char1, Char2)(const(Char1)[] s, const(Char2)sub)
{
    const(Char1)[] balance = find!({})(s, sub);
    return -1;
}

string extStr;
void main()
{
    extStr.indexOf("bla");
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 05 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7199




12:48:05 PST ---
A simplified example:

void find(alias pred)()
{
    bool hay()
    {
        return true;
    }
}

void index()
{
    find!({})();
}

void main()
{
    index();
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 05 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7199




Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/9c38305a4d4a910b56c498ddece7c85ff7fb8f97
fix Issue 7199 - std.string.indexof cannot be compiled with -inline

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 05 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7199


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 05 2012