Bug 174 – segfault with class member template function
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
PowerPC
OS
Linux
Creation time
2006-06-03T22:50:00Z
Last change time
2015-06-09T05:15:19Z
Keywords
ice-on-valid-code
Assigned to
dvdfrdmn
Creator
casantander1
Comments
Comment #0 by casantander1 — 2006-06-03T22:50:56Z
Under Linux PPC, given these two files:
//----------------------------
module foo;
class Foo
{
template xyz (T)
{
T xyz (uint i)
{
}
}
}
//----------------------------
module bar;
import foo;
void baz ()
{
Foo f;
f.xyz!(char []) (0);
}
//----------------------------
$ gdmd bar.d -g -c
foo.d: En la función ‘xyz’:
foo.d:9: error interno del compilador: Violación de segmento
Por favor envíe un reporte completo de bichos,
con el código preprocesado si es apropiado.
Vea <URL:http://gcc.gnu.org/bugs.html> para más instrucciones.
Comment #1 by lovesyao — 2006-11-18T21:20:32Z
I also met this bug. More simple testcase:
class Test{
template test(){
const int test=1;
}
}
void main(){
assert(Test.test!()==1);//ok
assert((new Test).test!()==1);//failed
}
Comment #2 by lovesyao — 2006-11-19T01:35:35Z
Sorry, I was mistaken(but maybe same cause). I'll create new bug.