diff -r 05de34f712fe -r 219b49bf4a03 src/compiler/SemanticAnalysis.cpp --- a/src/compiler/SemanticAnalysis.cpp Sat Jan 12 16:35:26 2013 -0800 +++ b/src/compiler/SemanticAnalysis.cpp Sun Jan 27 17:34:30 2013 -0800 @@ -1103,7 +1103,7 @@ if (from->isInt32() && to->isBool()) return new (pool_) HConvert(hir->node(), to, OP_CVT_I2B, hir); - if (to->isEnum() && *from != to) + if (to->isEnum() && from->unqualified() != to->unqualified()) return typeFailure(hir->node()->pos(), from, to); if (to->isArray()) { @@ -1231,10 +1231,10 @@ return; } - if (!IsValidUncheckedType(sym->type())) { + if (!IsValidUncheckedType(sym->effective())) { char name[255]; cc_.reportError(node->pos(), Message_InvalidUncheckedCastTo, - GetTypeName(hir->type(), name, sizeof(name))); + GetTypeName(sym->type(), name, sizeof(name))); return; } if (!IsValidUncheckedType(hir->type())) { @@ -1244,7 +1244,7 @@ return; } - hir_ = new (pool_) HUnary(node, hir->type(), TOK_LABEL, hir); + hir_ = new (pool_) HUnary(node, sym->effective(), TOK_LABEL, hir); break; } }