Changeset a2a8d2a6 for src/Common


Ignore:
Timestamp:
Aug 25, 2016, 2:03:29 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, 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:
32a2a99
Parents:
486341f
git-author:
Rob Schluntz <rschlunt@…> (08/25/16 11:09:18)
git-committer:
Rob Schluntz <rschlunt@…> (08/25/16 14:03:29)
Message:

change constructor warnings into errors and update the test output

Location:
src/Common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Common/SemanticError.cc

    r486341f ra2a8d2a6  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // SemanticError.cc -- 
     7// SemanticError.cc --
    88//
    99// Author           : Richard C. Bilson
     
    2626
    2727SemanticError::SemanticError( std::string error ) {
    28         errors.push_back( std::string( "Error: " ) + error );
     28  append( error );
    2929}
    3030
    3131void SemanticError::append( SemanticError &other ) {
    32         errors.splice( errors.end(), other.errors );
     32  errors.splice( errors.end(), other.errors );
     33}
     34
     35void SemanticError::append( const std::string & msg ) {
     36  errors.push_back( std::string( "Error: ") + msg );
    3337}
    3438
  • src/Common/SemanticError.h

    r486341f ra2a8d2a6  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // SemanticError.h -- 
     7// SemanticError.h --
    88//
    99// Author           : Richard C. Bilson
     
    3131
    3232        void append( SemanticError &other );
     33        void append( const std::string & );
    3334        bool isEmpty() const;
    3435        void print( std::ostream &os );
     
    4243template< typename T >
    4344SemanticError::SemanticError( const std::string &error, const T *obj ) {
    44         std::ostringstream os;
    45         os << "Error: " << error;
    46         obj->print( os );
    47         errors.push_back( os.str() );
     45        append( toString( error, obj ) );
    4846}
     47
    4948
    5049#endif // SEMANTICERROR_H
Note: See TracChangeset for help on using the changeset viewer.