[Bug c/7508] GCC refuses to compile a declartion right after a 'case' in switch

price at ifa dot hawaii dot edu gcc-bugzilla@gcc.gnu.org
Thu Sep 15 18:44:00 GMT 2005


------- Additional Comments From price at ifa dot hawaii dot edu  2005-09-15 18:44 -------
To get it to compile, use curly brackets after the "case":

  case 1:
    {
        int y = 7;
    }


I would suggest that the existence of several duplicates argue for a clearer
error message.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7508



More information about the Gcc-bugs mailing list