Changes in src/SymTab/Validate.cc [095b99a:98538288]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Validate.cc
r095b99a r98538288 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/dtors 313 314 acceptAll( translationUnit, hoistDecls ); 314 315 ReplaceTypedef::replaceTypedef( translationUnit ); … … 336 337 Stats::Time::BlockGuard guard("validate-C"); 337 338 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/dtors339 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 , "Constructors, destructors, and assignment functions require at least one parameter" );1184 SemanticError( funcDecl->location, "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 , "First parameter of a constructor, destructor, or assignment function must be a reference" );1188 SemanticError( funcDecl->location, "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 SemanticError( funcDecl, "Constructors and destructors cannot have explicit return values " ); 1191 if(!returnVals.front()->get_type()->isVoid()) { 1192 SemanticError( funcDecl->location, "Constructors and destructors cannot have explicit return values." ); 1193 } 1192 1194 } 1193 1195 }
Note: See TracChangeset
for help on using the changeset viewer.