[Issue 6358] New: ICE when using an member template (not a template instance) in an expression.
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Jul 20 14:15:50 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6358
Summary: ICE when using an member template (not a template
instance) in an expression.
Product: D
Version: D2
Platform: Other
OS/Version: Mac OS X
Status: NEW
Keywords: ice-on-invalid-code
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: kennytm at gmail.com
--- Comment #0 from kennytm at gmail.com 2011-07-20 14:15:47 PDT ---
Test case:
-------------------------------------------
struct S6358 {
double peek(T)(int x) {
return 0;
}
}
void bug6358a() {
S6358 s;
cast(void) (s.peek is &s); // <-- (a)
}
void bug6358b() {
S6358 s;
cast(void) (s.peek + &s); // <-- (b)
}
void bug6358c() {
S6358 s;
s.peek += 1; // <-- (c)
}
-------------------------------------------
The ICE in (a) happens at:
Expression *BinExp::typeCombine(Scope *sc)
{
Type *t1 = e1->type->toBasetype();
Type *t2 = e2->type->toBasetype(); // <-- this line, e2->type == NULL
if (op == TOKmin || op == TOKadd)
{
The ICE in (b) happens at:
AggregateDeclaration *isAggregate(Type *t)
{
t = t->toBasetype(); // <-- this line, t == NULL
if (t->ty == Tclass)
{
The ICE in (c) happens at:
int CallExp::isLvalue()
{
// if (type->toBasetype()->ty == Tstruct)
// return 1;
Type *tb = e1->type->toBasetype(); // <-- the line, e1->type == NULL
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list