LOL! I've done that before, it took him a little while to explain to me that we had just been sleeping a few moments before I yelled at him. When I realized it I felt really silly and kinda bad for barking when barking wasn't needed.
I do this to my hubby from time to time, I will wake up after a dream where he was mean to me and say, "I'm so mad at you....you were a jerk to me in my dream". *grump*
THIS REALLY HAPPENS!
except I don't punch him.