#!/usr/bin/env rdmd
import core.stdc.stdio;
template G(size_t line = __LINE__, A...){
int i = 3;
static extern(C) pragma(crt_constructor) void init2(){
printf("init: %d\n", line);
}
}
pragma(crt_constructor) extern(C) void init1(){
printf("init from global\n");
}
struct A {
mixin G!();
}
extern(C) void main(){
mixin G!() g;
printf("g.i=%d\n", g.i);
g.init2(); // remove this can build, but g.init2 not get called!
}
-----------------
build error:
Undefined symbols for architecture x86_64:
"__D4test4mainUZ1g5init2UNbNiZv", referenced from:
is this a bug ? mixin template static function missing!
learnfirst1 via Digitalmars-d-learn Fri, 10 Aug 2018 01:36:01 -0700
- is this a bug ? mixin template sta... learnfirst1 via Digitalmars-d-learn
- Re: is this a bug ? mixin tem... Simen Kjærås via Digitalmars-d-learn
- Re: is this a bug ? mixin... learnfirst1 via Digitalmars-d-learn
- Re: is this a bug ? m... Simen Kjærås via Digitalmars-d-learn
- Re: is this a bug ... learnfirst1 via Digitalmars-d-learn
- Re: is this a bug ? mixin... learnfirst1 via Digitalmars-d-learn
