From d33c85dfbe50039a64595829cdcdf0d641042dc6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 30 Sep 2019 12:59:42 +0200 Subject: Diagnose `case` and `default` outside `switch` --- libbuild2/parser.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libbuild2/parser.cxx') diff --git a/libbuild2/parser.cxx b/libbuild2/parser.cxx index a8abbfb..a6a5a83 100644 --- a/libbuild2/parser.cxx +++ b/libbuild2/parser.cxx @@ -392,7 +392,8 @@ namespace build2 { f = &parser::parse_switch; } - else if (n == "case") + else if (n == "case" || + n == "default") { // Valid ones are handled in parse_switch(). // -- cgit v1.1