Thats part of your miranda rights so i think that really only applies when you are in custody,If cops question you and you dont tell them what happened technically you could be could be considered an accessory after the fact, or charged with interfering with an investigation. But you dont have to come forward to the cops about a crime you witnessed. I would recomend doing so if you are getting charged though.