``` 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 ;
`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.