@jwe: I checked the patch in under your credentials here (http://hg.savannah.gnu.org/hgweb/octave/rev/e6b037514f56).
I amended it slightly. There seems to be a bit of a convention to use do_XXX for the internal function which implements the user visible XXX function. Hence, I renamed blkmm_ov to do_blkmm. I also rolled the templated blkmm and blkmm_ov in to the one function do_blkmm because they were both short and it didn't seem necessary to have so many templated functions. I added a BIST test for this bug as well.
Marking as fixed and closing report.

@jwe: Maybe you can answer this question. The fix for this bug is conceptually simple, check for empty matrix inputs and return an empty matrix output if that is the case. However, in order to get the correct output type, double; double complex; single; single complex, it appears like the code to check for an empty matrix would need to be repeated four times. Simple, but ugly.
My proof of concept working only with double arrays is below
Is there any good way of avoiding the repetition of "if (m ==0  n == 0)" within each branch of the if/else tree which decodes type?
If not, I'll just duplicate the tests.

Confirmed. I suppose what is really needed is a test in blkmm for an empty matrix (m = 0 or p = 0). In that case, there is no need to call the underlying multiplication routines. Doing a little debugging with ordinary matrices
So in the following case, the output should be [](0x4x3), instead of an error.

Let size(A)=[m,p,q], size(B)=[p,n,q], C=blkmm(A,B), then size(C)=[m,n,q].
If (m=0 and n=1) or (m=1 and p=0 and n!=1), then blkmm will raise the following error:
This is a small issue, since it only raises errors for some size of empty input.
The following test code will show the above result.
and the output of the above code is as follow.
