Sorry if I'm talking bullshit here, maybe I just don't get it but:

But if I just remove that line all functions which are not contracts and have a context won't be marked as weak? Remember if this check succeeds, the function is __not__ marked as weak. The if statement basically means:
* If decl_tree is not public, don't mark as weak
* If decl_tree is a nested function and not a contract don't mark it as weak

so contracts are actually not affected by this if statement, only if they're private they're not emitted. As the second part only applies to nested functions which are not contracts, we can just remove it, no?

example:
```d
struct Test(T)
{
    void func()
    {
    }
}

Test!int a;
```

right now:
gdc -c test.d
nm test.o 
0000000000000000 W _D4test11__T4TestTiZ4Test4funcMFZv

with ```&& D_DECL_STATIC_CHAIN (decl_tree) == 1``` removed:
gdc -c test.d
nm test.o 
0000000000000000 T _D4test11__T4TestTiZ4Test4funcMFZv