www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12426] New: Spurious "auto can only be used for template function parameters" for overloaded templated functions

https://d.puremagic.com/issues/show_bug.cgi?id=12426

           Summary: Spurious "auto can only be used for template function
                    parameters" for overloaded templated functions
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic, rejects-valid
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: thecybershadow gmail.com



19:40:17 EET ---
///////// test.d ////////
void fun(T)(auto ref T t)
    if (false)
{
}

void fun(T)()
{
}

alias fun!int funint;
/////////////////////////

Compiler complains:
test.d(1): Error: auto can only be used for template function parameters

Not only is this error spurious (the constraint will never pass), but the
compiler does not indicate the location of the instantiation.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 20 2014