Thanks to some help on the Clang mailing list, I now have a solution to the original problem. The tiny test case above was reduced too far by creduce (I should have told it not to accept code that gives compiler warnings) and is not the cause of the original issue.
If I change line 67 of dmtest.cxx from
L(i,colon()) = ( L(i,colon())&( x-pointx(j)*ones(1,length(x)) ) )/(pointx(i)-pointx(j));
to
L(i,colon()) = elemProduct( L(i,colon()),( x-pointx(j)*ones(1,length(x)) ) )/(pointx(i)-pointx(j));
then Clang and GCC both compile and run successfully, giving the same output.
There may be some undefined behavior triggered by the allocation of temporary matrices, since
DMatrix& DMatrix::operator &(const DMatrix B) const
is by-value whereas
DMatrix& elemProduct( const DMatrix& A, const DMatrix& B )
is by-reference. Otherwise operator& just calls elemProduct, so they should result in the same numerical output.