Changes in src/SymTab/Validate.cc [98538288:095b99a]
- File:
-
- 1 edited
-
src/SymTab/Validate.cc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Validate.cc
r98538288 r095b99a 311 311 Stats::Heap::newPass("validate-A"); 312 312 Stats::Time::BlockGuard guard("validate-A"); 313 VerifyCtorDtorAssign::verify( translationUnit ); // must happen before autogen, because autogen examines existing ctor/dtors314 313 acceptAll( translationUnit, hoistDecls ); 315 314 ReplaceTypedef::replaceTypedef( translationUnit ); … … 337 336 Stats::Time::BlockGuard guard("validate-C"); 338 337 acceptAll( translationUnit, genericParams ); // check as early as possible - can't happen before LinkReferenceToTypes_old 338 VerifyCtorDtorAssign::verify( translationUnit ); // must happen before autogen, because autogen examines existing ctor/dtors 339 339 ReturnChecker::checkFunctionReturns( translationUnit ); 340 340 InitTweak::fixReturnStatements( translationUnit ); // must happen before autogen … … 1182 1182 if ( CodeGen::isCtorDtorAssign( funcDecl->get_name() ) ) { // TODO: also check /=, etc. 1183 1183 if ( params.size() == 0 ) { 1184 SemanticError( funcDecl ->location, "Constructors, destructors, and assignment functions require at least one parameter." );1184 SemanticError( funcDecl, "Constructors, destructors, and assignment functions require at least one parameter " ); 1185 1185 } 1186 1186 ReferenceType * refType = dynamic_cast< ReferenceType * >( params.front()->get_type() ); 1187 1187 if ( ! refType ) { 1188 SemanticError( funcDecl ->location, "First parameter of a constructor, destructor, or assignment function must be a reference." );1188 SemanticError( funcDecl, "First parameter of a constructor, destructor, or assignment function must be a reference " ); 1189 1189 } 1190 1190 if ( CodeGen::isCtorDtor( funcDecl->get_name() ) && returnVals.size() != 0 ) { 1191 if(!returnVals.front()->get_type()->isVoid()) { 1192 SemanticError( funcDecl->location, "Constructors and destructors cannot have explicit return values." ); 1193 } 1191 SemanticError( funcDecl, "Constructors and destructors cannot have explicit return values " ); 1194 1192 } 1195 1193 }
Note:
See TracChangeset
for help on using the changeset viewer.