Changeset a436947 for src/ResolvExpr/Resolver.cc
- Timestamp:
- Jun 7, 2016, 3:59:15 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- d0f8b19
- Parents:
- db175c8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Resolver.cc
rdb175c8 ra436947 38 38 virtual void visit( ObjectDecl *functionDecl ); 39 39 virtual void visit( TypeDecl *typeDecl ); 40 virtual void visit( EnumDecl * enumDecl ); 40 41 41 42 virtual void visit( ArrayType * at ); … … 66 67 Type *initContext; 67 68 Type *switchType; 69 bool inEnumDecl = false; 68 70 }; 69 71 … … 178 180 Type *temp = initContext; 179 181 initContext = new_type; 182 if ( inEnumDecl && dynamic_cast< EnumInstType * >( initContext ) ) { 183 // enumerator initializers should not use the enum type to initialize, since 184 // the enum type is still incomplete at this point. Use signed int instead. 185 initContext = new BasicType( Type::Qualifiers(), BasicType::SignedInt ); 186 } 180 187 SymTab::Indexer::visit( objectDecl ); 188 if ( inEnumDecl && dynamic_cast< EnumInstType * >( initContext ) ) { 189 // delete newly created signed int type 190 delete initContext; 191 } 181 192 initContext = temp; 182 193 } … … 216 227 SymTab::Indexer::visit( functionDecl ); 217 228 functionReturn = oldFunctionReturn; 229 } 230 231 void Resolver::visit( EnumDecl * enumDecl ) { 232 // in case we decide to allow nested enums 233 bool oldInEnumDecl = inEnumDecl; 234 inEnumDecl = true; 235 SymTab::Indexer::visit( enumDecl ); 236 inEnumDecl = oldInEnumDecl; 218 237 } 219 238
Note: See TracChangeset
for help on using the changeset viewer.