www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20087] New: `scope` not parsed for types in template argument

https://issues.dlang.org/show_bug.cgi?id=20087

          Issue ID: 20087
           Summary: `scope` not parsed for types in template argument
                    lists
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: slavo5150 yahoo.com

```
template __externC(RT, P...)
{
    alias __externC = extern(C) RT function(P);
}

extern(C) void* test(scope const char*);

static assert(is(typeof(&test)   == __externC!(void*, scope const char*)));
```

Last line fails with:

Error: expression expected, not scope
Error: found const when expecting ) following template argument list
Error: found char when expecting )
Error: expression expected, not )
Error: found ) when expecting ;

--
Jul 26 2019