Changeset 8e04794 for src/ResolvExpr


Ignore:
Timestamp:
Nov 7, 2018, 2:16:33 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
909aebf
Parents:
f441c88
Message:

Fixed basetypeof for enum types

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/ResolveTypeof.cc

    rf441c88 r8e04794  
    9191                // clear qualifiers for base, combine with typeoftype quals in any case
    9292                if ( isBasetypeof ) {
     93                        // replace basetypeof(<enum>) by int
     94                        if ( dynamic_cast<EnumInstType*>(newType) ) {
     95                                Type* newerType =
     96                                        new BasicType{ newType->get_qualifiers(), BasicType::SignedInt,
     97                                        newType->attributes };
     98                                delete newType;
     99                                newType = newerType;
     100                        }
    93101                        newType->get_qualifiers().val
    94102                                = ( newType->get_qualifiers().val & ~Type::Qualifiers::Mask ) | oldQuals;
Note: See TracChangeset for help on using the changeset viewer.