Skip to content

Commit

Permalink
Merge pull request #5774 from 9rnsr/fix16022
Browse files Browse the repository at this point in the history
[REG2.069] Issue 16022 - dmd assertion failure due to misplaced comma operator
  • Loading branch information
WalterBright committed May 14, 2016
2 parents 0c882ef + dd3e980 commit 35190b0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/denum.d
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ public:
sc = _scope;

protection = ed.isAnonymous() ? ed.protection : Prot(PROTpublic);
linkage = LINKd;
storage_class = STCmanifest;
userAttribDecl = ed.isAnonymous() ? ed.userAttribDecl : null;

Expand Down
3 changes: 2 additions & 1 deletion src/tocsym.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ Symbol *toSymbol(Dsymbol *s)
m = mTYman_d;
break;
default:
printf("linkage = %d\n", vd->linkage);
printf("linkage = %d, vd = %s %s @ [%s]\n",
vd->linkage, vd->kind(), vd->toChars(), vd->loc.toChars());
assert(0);
}

Expand Down
10 changes: 10 additions & 0 deletions test/runnable/xtest46.d
Original file line number Diff line number Diff line change
Expand Up @@ -7799,6 +7799,16 @@ struct Grapheme15961
}
}

/***************************************************/
// 16022

bool test16022()
{
enum Type { Colon, Comma }
Type type;
return type == Type.Colon, type == Type.Comma;
}

/***************************************************/

int main()
Expand Down

0 comments on commit 35190b0

Please sign in to comment.