Message ID | mcrfvw4lbso.fsf@iant-glaptop.roam.corp.google.com |
---|---|
State | New |
Headers | show |
diff -r 133fcbfa33c6 go/parse.cc --- a/go/parse.cc Wed Jun 26 15:31:30 2013 -0700 +++ b/go/parse.cc Wed Jun 26 15:44:23 2013 -0700 @@ -4523,9 +4523,12 @@ bool is_fallthrough = false; if (this->peek_token()->is_keyword(KEYWORD_FALLTHROUGH)) { + Location fallthrough_loc = this->location(); is_fallthrough = true; if (this->advance_token()->is_op(OPERATOR_SEMICOLON)) this->advance_token(); + if (this->peek_token()->is_op(OPERATOR_RCURLY)) + error_at(fallthrough_loc, _("cannot fallthrough final case in switch")); } if (is_default)