Bug 3691 – compiler 1.055 crashes with some invalid code in is(typeof())
Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
Other
OS
Mac OS X
Creation time
2010-01-08T08:23:00Z
Last change time
2014-04-18T09:12:05Z
Assigned to
nobody
Creator
fawzi
Comments
Comment #0 by fawzi — 2010-01-08T08:23:36Z
{{{
template RefType(T) {
static if (is(T == class)) {
alias T RefType;
} else {
alias T* RefType;
}
}
template UnrefType(T) {
static if (is(T == class)) {
alias T UnrefType;
} else {
alias typeof(*T) UnrefType;
}
}
struct P{
int i;
}
void f(T)(){
static if(is(typeof(function RefType!(P)(){ return new UnrefType!(P); }))){
pragma(msg,"pippo");
}
}
void g(){
f!(P)();
}
}}}
crashes the compiler (1.055) it seems that unreferencing the structure (which cannot be done) really upsets the compiler.
This used to work, and basically anything syntactically parseable should be accepted in is(typeof()) without crashing the compiler (it should just return false).
Comment #1 by matti.niemenmaa+dbugzilla — 2010-01-08T08:27:28Z
*** This issue has been marked as a duplicate of issue 3685 ***