Second-Order Conditions for Optimization Problems with Constraints