I have never used the second one, and almost never see it. Personally, it looks a little counter-intuitive (but that's just me).
"void::class1" makes me think of a class called "void" and a function called "class1" (we, of course, can't have a function called "void").
I believe what is actually being parsed for the second is: void ::class1::function(){ }
where you are accessing the global namespace as opposed to the current one. They are not identical in meaning unless the first is already in the global namespace.