This code is inside a view function and gives the error : Function declared as view but this potentially modifies state.
if ( auction.iS == false){ //check if such auction exists
emit NoSuchAuction(msg.sender, _auctionName);
return; }
NoSuchAuction() is an event. _auctionName is a string. auction is a structure and iS is a boolean.