src/compiler/SemanticAnalysis.cpp
changeset 261 219b49bf4a03
parent 259 99ab8b19f0b9
child 262 c4b1341297e5
     1.1 --- a/src/compiler/SemanticAnalysis.cpp	Sat Jan 12 16:35:26 2013 -0800
     1.2 +++ b/src/compiler/SemanticAnalysis.cpp	Sun Jan 27 17:34:30 2013 -0800
     1.3 @@ -1103,7 +1103,7 @@
     1.4      if (from->isInt32() && to->isBool())
     1.5          return new (pool_) HConvert(hir->node(), to, OP_CVT_I2B, hir);
     1.6  
     1.7 -    if (to->isEnum() && *from != to)
     1.8 +    if (to->isEnum() && from->unqualified() != to->unqualified())
     1.9          return typeFailure(hir->node()->pos(), from, to);
    1.10      
    1.11      if (to->isArray()) {
    1.12 @@ -1231,10 +1231,10 @@
    1.13              return;
    1.14          }
    1.15  
    1.16 -        if (!IsValidUncheckedType(sym->type())) {
    1.17 +        if (!IsValidUncheckedType(sym->effective())) {
    1.18              char name[255];
    1.19              cc_.reportError(node->pos(), Message_InvalidUncheckedCastTo,
    1.20 -                            GetTypeName(hir->type(), name, sizeof(name)));
    1.21 +                            GetTypeName(sym->type(), name, sizeof(name)));
    1.22              return;
    1.23          }
    1.24          if (!IsValidUncheckedType(hir->type())) {
    1.25 @@ -1244,7 +1244,7 @@
    1.26              return;
    1.27          }
    1.28  
    1.29 -        hir_ = new (pool_) HUnary(node, hir->type(), TOK_LABEL, hir);
    1.30 +        hir_ = new (pool_) HUnary(node, sym->effective(), TOK_LABEL, hir);
    1.31          break;
    1.32        }
    1.33      }