You do know that in most places you are allowed to refuse a search by police right?
"I do not consent to searches" and if you insist on that statement and continue to refuse because they are going to try to convince you that your better off being searched so that you can be on your way. That is when you say "Am I being detained?" if they have no reason to detain you ask "am I free to go?" and if they have no reason to keep you there you can be on your way.
If you are not on drugs or alcohol, and you aren't on some probation or parole that prevents you from having a gun and pretty much makes the above statement ineffective you shouldn't have a gun on you in the first place.
If they do ask you to get out of the car I think that it should be brought up if you have the gun on your person, but if its just in a bag in the car I don't think it needs to be any of their business.