Changeset 5b51f5e for src/SymTab/Validate.cc
- Timestamp:
- Jan 5, 2018, 3:21:42 PM (6 years ago)
- 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:
- 65deb18, cae28da
- Parents:
- 5c4f2c2 (diff), b834e98 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Validate.cc
r5c4f2c2 r5b51f5e 94 94 template< typename AggDecl > void handleAggregate( AggDecl *aggregateDecl ); 95 95 96 bool inStruct = false;96 AggregateDecl * parentAggr = nullptr; 97 97 }; 98 98 … … 303 303 template< typename AggDecl > 304 304 void HoistStruct::handleAggregate( AggDecl *aggregateDecl ) { 305 if ( inStruct) {305 if ( parentAggr ) { 306 306 // Add elements in stack order corresponding to nesting structure. 307 307 declsToAddBefore.push_front( aggregateDecl ); 308 308 } else { 309 GuardValue( inStruct);310 inStruct = true;309 GuardValue( parentAggr ); 310 parentAggr = aggregateDecl; 311 311 } // if 312 312 // Always remove the hoisted aggregate from the inner structure. … … 754 754 throw SemanticError( "Cannot redefine typedef: " + tyDecl->name ); 755 755 } 756 // cannot redefine VLA typedefs 756 // Cannot redefine VLA typedefs. Note: this is slightly incorrect, because our notion of VLAs 757 // at this point in the translator is imprecise. In particular, this will disallow redefining typedefs 758 // with arrays whose dimension is an enumerator or a cast of a constant/enumerator. The effort required 759 // to fix this corner case likely outweighs the utility of allowing it. 757 760 if ( isVariableLength( t1 ) || isVariableLength( t2 ) ) { 758 761 throw SemanticError( "Cannot redefine typedef: " + tyDecl->name );
Note: See TracChangeset
for help on using the changeset viewer.