5. Given that $\sin \alpha, \cos \alpha$ are the roots of the equation $x^{2}-\sqrt{m} x+$ $\frac{1}{2}=0$. Then the triangle with side lengths $\sin \alpha, \cos \alpha, \frac{1}{2} m$ is ( ).
(A) scalene triangle
(B) isosceles triangle
(C) isosceles right triangle
(D) none of the above answers is correct
5.C.

From the given, we have $\sin \alpha + \cos \alpha = \sqrt{m}, \sin \alpha \cdot \cos \alpha = \frac{1}{2}$. Solving this, we get $m=2$.
Also, $\Delta = (-\sqrt{m})^2 - 4 \times \frac{1}{2} = m - 2 = 0$, so $\sin \alpha = \cos \alpha$.
Since $\sin^2 \alpha + \cos^2 \alpha = 1 = \left(\frac{1}{2} m\right)^2$, the triangle with sides of lengths $\sin \alpha$, $\cos \alpha$, and $\frac{1}{2} m$ is an isosceles right triangle.