Interesting question. With regard to stop and frisk, the U.S. Supreme Court stated in Arizona v. Johnson, a 2009 opinion (citation omitted), that the stop must first be lawful, and second, the officer must reasonably suspect that the person is armed and dangerous. Clearly under this scenario the officer knows the person is armed, but there are no facts to indicate the person is dangerous. The suspect has a valid CCL license and, pursuant to law, so advises the officer. The fact that the person has a CCL is evidence that he has gone through a record check and is legally entitled to be armed. Assuming all the officer had was a traffic violation, the search was illegal. In short, the cop f----d up, and had he found contraband on the suspect, the evidence would be suppressed.
I'm with Jhat. Based strictly on that information, that frisk was not legal. Terry is just the tip of the iceberg and it's an extremely complicated topic, but it comes down to scope of a traffic stop and reasonable suspicion that criminal activity is afoot. The scope of the original traffic stop is the traffic violation only. If the officer had noticed the firearm before or without receiving the license, he could have performed the stop and frisk because that expanded the scope. Since that didn't happen, he's just back to the traffic violation. In addition to case law, as mentioned by another poster, the statute specifically prohibits an officer from inspecting the weapon.
Where's my double facepalm?