THRIFT-423. -strict should turn omitted field ids into compile error
Issue name says it all.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@761736 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/thrifty.yy b/compiler/cpp/src/thrifty.yy
index c050590..bf5408e 100644
--- a/compiler/cpp/src/thrifty.yy
+++ b/compiler/cpp/src/thrifty.yy
@@ -848,6 +848,10 @@
pdebug("tok_int_constant : Field -> FieldType tok_identifier");
if ($2 < 0) {
pwarning(1, "No field key specified for %s, resulting protocol may have conflicts or not be backwards compatible!\n", $5);
+ if (g_strict >= 192) {
+ yyerror("Implicit field keys are deprecated and not allowed with -strict");
+ exit(1);
+ }
}
$$ = new t_field($4, $5, $2);
$$->set_req($3);