Comment #2 by kamm-removethis — 2008-07-12T02:33:49Z
In LLVMDC we fixed this_14_G/H by making the "constructors/destructors are only for class definitions" error fatal. Otherwise you get a segfault around func.c line 908 trying to access the InvariantDeclaration of the AggregateDeclatation* ad that is zero.
Comment #3 by bugs-d — 2009-03-30T00:28:40Z
Created attachment 305
Verify isThis() in addPostInvariant() and addPreInvariant().
This patch fixes G/H while handling errors normally. All of the other is*Invariant() methods check for ad, but static contructors and desctrutors assume it's there, seemingly.
-[Unknown]
Comment #4 by bugs-d — 2009-03-30T00:31:40Z
Created attachment 306
Validate that a static destructor has a parent.
This fixes this_14_I. It just adds a clause, similar to the one for static constructors, for static destructors. This throws a very similar error and doesn't crash.
-[Unknown]
Comment #5 by clugdbug — 2009-04-20T04:09:49Z
*** Bug 1533 has been marked as a duplicate of this bug. ***
Comment #6 by clugdbug — 2009-04-20T04:15:05Z
Another example of 14G/14H, from bug 1533. [Unknown]'s patch fixes this, but does result in one of the error messages having no line number.
---
template T(){
this(int i){} // causes 14G segfault
~this() {} // causes 14H segfault
}
struct C{
void foo(){
bar();
this.t(7);
}
mixin T!() t;
}
Comment #7 by clugdbug — 2009-05-14T04:54:41Z
Fixed DMD2.030 and 1.045.
The segfault bug in 14G and 14H is fixed, as are all of the ICE bugs. 14G has one error without line number ("Error: 'this' is only defined in non-static member functions, not this") but since it comes after errors with line numbers, it's trivial.