diff --git a/shared/cplusplus/PrettyPrinter.cpp b/shared/cplusplus/PrettyPrinter.cpp
index 620cb0bd2a0f4ec08d7b8e7c4f36d283d476d184..2acb98b14e185778dc7775c2d9d42cd1fa8bf771 100644
--- a/shared/cplusplus/PrettyPrinter.cpp
+++ b/shared/cplusplus/PrettyPrinter.cpp
@@ -198,7 +198,24 @@ bool PrettyPrinter::visit(CaseStatementAST *ast)
     out << "case ";
     accept(ast->expression);
     out << ':';
-    accept(ast->statement);
+    if (! ast->statement) {
+        newline();
+        return false;
+    }
+
+    if (ast->statement->asCompoundStatement()) {
+        out << ' ';
+        accept(ast->statement);
+    } else if (ast->statement->asCaseStatement() || ast->statement->asLabeledStatement()) {
+        newline();
+        accept(ast->statement);
+    } else {
+        indent();
+        newline();
+        accept(ast->statement);
+        deindent();
+        newline();
+    }
     return false;
 }
 
diff --git a/tests/manual/cplusplus/tests/t1.cpp b/tests/manual/cplusplus/tests/t1.cpp
index 2a64b291846ec518d3f29a64809b7a32fa4e9986..5457def79eb3ce19ad3aaf40e5d1d3f40bc9496b 100644
--- a/tests/manual/cplusplus/tests/t1.cpp
+++ b/tests/manual/cplusplus/tests/t1.cpp
@@ -35,6 +35,11 @@ class Class {
     switch (int k) {
     case 'a': case 'b': case '\\':
       return 1;
+    case 1|2: { return 3; } break;
+    case x: break;
+    case y:
+      foo();
+      break;
     default:
       return 2;
     }