Changeset 3de176d


Ignore:
Timestamp:
Nov 24, 2017, 3:05:47 PM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
a7caf3d, c0d00b6, f5478c8, f7a4f89
Parents:
3787dc1
Message:

Add outline for stopping enumerators from being lvalues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.cc

    r3787dc1 r3de176d  
    8888        Type * type = var->get_type()->clone();
    8989        type->set_lvalue( true );
     90
     91        // xxx - doesn't quite work yet - get different alternatives with the same cost
     92
     93        // // enumerators are not lvalues
     94        // if ( EnumInstType * inst = dynamic_cast< EnumInstType * >( var->get_type() ) ) {
     95        //      assert( inst->baseEnum );
     96        //      EnumDecl * decl = inst->baseEnum;
     97        //      for ( Declaration * member : decl->members ) {
     98        //              if ( member == _var ) {
     99        //                      type->set_lvalue( false );
     100        //              }
     101        //      }
     102        // }
     103
    90104        set_result( type );
    91105}
Note: See TracChangeset for help on using the changeset viewer.