Veteran US Senator John McCain, a former prisoner of war and the 2008 Republican presidential nominee, has been diagnosed with brain cancer.