Ignore:
Timestamp:
Aug 3, 2018, 11:56:53 AM (3 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer
Children:
f271bdd
Parents:
3537dd7
Message:

Resolve enumerator initializers early to allow other passes to determine if expression is constexpr and to evaluate constexprs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Validate.cc

    r3537dd7 rac3362c  
    738738                                forwardEnums.erase( fwds );
    739739                        } // if
     740
     741                        for ( Declaration * member : enumDecl->members ) {
     742                                ObjectDecl * field = strict_dynamic_cast<ObjectDecl *>( member );
     743                                if ( field->init ) {
     744                                        // need to resolve enumerator initializers early so that other passes that determine if an expression is constexpr have the appropriate information.
     745                                        SingleInit * init = strict_dynamic_cast<SingleInit *>( field->init );
     746                                        ResolvExpr::findSingleExpression( init->value, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), indexer );
     747                                }
     748                        }
    740749                } // if
    741750        }
Note: See TracChangeset for help on using the changeset viewer.