Changeset d55d7a6 for src/Parser/DeclarationNode.cc
- Timestamp:
- Feb 15, 2018, 3:58:56 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:
- 75e3cb2
- Parents:
- d27e340
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
rd27e340 rd55d7a6 581 581 dst->basictype = src->basictype; 582 582 } else if ( src->basictype != DeclarationNode::NoBasicType ) 583 throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::basicTypeNames[ src->basictype ] + " in type: ", src);583 throw SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::basicTypeNames[ src->basictype ] + " in type: " ); 584 584 585 585 if ( dst->complextype == DeclarationNode::NoComplexType ) { 586 586 dst->complextype = src->complextype; 587 587 } else if ( src->complextype != DeclarationNode::NoComplexType ) 588 throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::complexTypeNames[ src->complextype ] + " in type: ", src);588 throw SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::complexTypeNames[ src->complextype ] + " in type: " ); 589 589 590 590 if ( dst->signedness == DeclarationNode::NoSignedness ) { 591 591 dst->signedness = src->signedness; 592 592 } else if ( src->signedness != DeclarationNode::NoSignedness ) 593 throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::signednessNames[ src->signedness ] + " in type: ", src);593 throw SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::signednessNames[ src->signedness ] + " in type: " ); 594 594 595 595 if ( dst->length == DeclarationNode::NoLength ) { … … 598 598 dst->length = DeclarationNode::LongLong; 599 599 } else if ( src->length != DeclarationNode::NoLength ) 600 throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::lengthNames[ src->length ] + " in type: ", src);600 throw SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::lengthNames[ src->length ] + " in type: " ); 601 601 } // if 602 602 break; … … 966 966 } // if 967 967 } catch( SemanticError &e ) { 968 e.set_location( cur->location );969 968 errors.append( e ); 970 969 } // try … … 1001 1000 } // if 1002 1001 } catch( SemanticError &e ) { 1003 e.set_location( cur->location );1004 1002 errors.append( e ); 1005 1003 } // try … … 1020 1018 * out++ = cur->buildType(); 1021 1019 } catch( SemanticError &e ) { 1022 e.set_location( cur->location );1023 1020 errors.append( e ); 1024 1021 } // try … … 1032 1029 1033 1030 Declaration * DeclarationNode::build() const { 1034 if ( ! error.empty() ) throw SemanticError( error + " in declaration of ", this);1031 if ( ! error.empty() ) throw SemanticError( this, error + " in declaration of " ); 1035 1032 1036 1033 if ( asmStmt ) { … … 1055 1052 // inline _Noreturn int i; // disallowed 1056 1053 if ( type->kind != TypeData::Function && funcSpecs.any() ) { 1057 throw SemanticError( "invalid function specifier for ", this);1054 throw SemanticError( this, "invalid function specifier for " ); 1058 1055 } // if 1059 1056 return buildDecl( type, name ? *name : string( "" ), storageClasses, maybeBuild< Expression >( bitfieldWidth ), funcSpecs, linkage, asmName, maybeBuild< Initializer >(initializer), attributes )->set_extension( extension ); … … 1065 1062 // inlne _Noreturn enum E { ... }; // disallowed 1066 1063 if ( funcSpecs.any() ) { 1067 throw SemanticError( "invalid function specifier for ", this);1064 throw SemanticError( this, "invalid function specifier for " ); 1068 1065 } // if 1069 1066 assertf( name, "ObjectDecl must a have name\n" );
Note: See TracChangeset
for help on using the changeset viewer.