There is specific case law from the USSC that prevents this. I'm not saying it's right, but in Indiana, carrying a firearm is illegal without a license and an officer has a right to detain you until you prove that you have a valid license.
There is a gray area there.. I think if the officer has "reason" to believe a law is being broken they can do what they feel is necessary.
A firearm is just a clear "reason".
A garantee you any police officer can come up with some reason to detain and question someone and it would be accepted.