Changeset d55d7a6 for src/InitTweak


Ignore:
Timestamp:
Feb 15, 2018, 3:58:56 PM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
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:
75e3cb2
Parents:
d27e340
Message:

Massive change to errors to enable warnings

Location:
src/InitTweak
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/FixInit.cc

    rd27e340 rd55d7a6  
    282282                                        translationUnit.splice( i, fixer.pass.staticDtorDecls );
    283283                                } catch( SemanticError &e ) {
    284                                         e.set_location( (*i)->location );
    285284                                        errors.append( e );
    286285                                } // try
     
    895894                        )
    896895                        if ( ! diff.empty() ) {
    897                                 throw SemanticError( std::string("jump to label '") + stmt->get_target().get_name() + "' crosses initialization of " + (*diff.begin())->get_name() + " ", stmt );
     896                                throw SemanticError( stmt, std::string("jump to label '") + stmt->get_target().get_name() + "' crosses initialization of " + (*diff.begin())->get_name() + " " );
    898897                        } // if
    899898                        // S_G-S_L results in set of objects that must be destructed
     
    11111110                template< typename Visitor, typename... Params >
    11121111                void error( Visitor & v, CodeLocation loc, const Params &... params ) {
    1113                         SemanticError err( toString( params... ) );
    1114                         err.set_location( loc );
     1112                        SemanticError err( loc, toString( params... ) );
    11151113                        v.errors.append( err );
    11161114                }
  • src/InitTweak/GenInit.cc

    rd27e340 rd55d7a6  
    317317                if ( tryConstruct( objDecl ) && ( managedTypes.isManaged( objDecl ) || ((! inFunction || objDecl->get_storageClasses().is_static ) && ! isConstExpr( objDecl->get_init() ) ) ) ) {
    318318                        // constructed objects cannot be designated
    319                         if ( isDesignated( objDecl->get_init() ) ) throw SemanticError( "Cannot include designations in the initializer for a managed Object. If this is really what you want, then initialize with @=.\n", objDecl );
     319                        if ( isDesignated( objDecl->get_init() ) ) throw SemanticError( objDecl, "Cannot include designations in the initializer for a managed Object. If this is really what you want, then initialize with @=.\n" );
    320320                        // constructed objects should not have initializers nested too deeply
    321                         if ( ! checkInitDepth( objDecl ) ) throw SemanticError( "Managed object's initializer is too deep ", objDecl );
     321                        if ( ! checkInitDepth( objDecl ) ) throw SemanticError( objDecl, "Managed object's initializer is too deep " );
    322322
    323323                        objDecl->set_init( genCtorInit( objDecl ) );
  • src/InitTweak/InitTweak.cc

    rd27e340 rd55d7a6  
    225225                                        // xxx - this shouldn't be an error, but need a way to
    226226                                        // terminate without creating output, so should catch this error
    227                                         throw SemanticError( "unbalanced list initializers" );
     227                                        throw SemanticError( init->location, "unbalanced list initializers" );
    228228                                }
    229229
Note: See TracChangeset for help on using the changeset viewer.