An adaptive cubic regularization algorithm for nonconvex optimization with convex constraints and its function-evaluation complexity