D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20087 - `scope` not parsed for types in template argument lists
Summary: `scope` not parsed for types in template argument lists
Status: RESOLVED INVALID
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P3 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-27 04:07 UTC by Mike Franklin
Modified: 2023-02-19 21:29 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Mike Franklin 2019-07-27 04:07:42 UTC
```
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 ;
Comment 1 Mathias LANG 2019-07-27 12:13:06 UTC
`scope` is a storage class, not a type modifier. So no, this code should not be valid. You can replace `scope` with `static` for a more "natural" example of the issue.