Ignore:
Timestamp:
Jan 3, 2018, 10:40:02 AM (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:
6138d0f, b834e98
Parents:
be9aa0f
Message:

Add error handling for C-style initialization of VLAs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Validate.cc

    rbe9aa0f r4b97770  
    754754                                throw SemanticError( "Cannot redefine typedef: " + tyDecl->name );
    755755                        }
    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.
    757760                        if ( isVariableLength( t1 ) || isVariableLength( t2 ) ) {
    758761                                throw SemanticError( "Cannot redefine typedef: " + tyDecl->name );
Note: See TracChangeset for help on using the changeset viewer.