The House approved legislation to align certain veterans and survivor benefits with Social Security’s cost-of-living adjustment.