Thrift compiler now enforces uniqueness of field identifiers
Summary: The code would either not generate, or generate code with errors, if you did this beforehand. Now it's a die-fast stop hard error since this is absolultely always a wrong thing to do.
Reviewed By: dreiss
Test Plan: Test compiling a .thrift file with a repeated field identifier in a struct or arglist.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665379 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/parse/t_field.h b/compiler/cpp/src/parse/t_field.h
index 25c50a5..35ee1a2 100644
--- a/compiler/cpp/src/parse/t_field.h
+++ b/compiler/cpp/src/parse/t_field.h
@@ -106,12 +106,12 @@
bool has_doc() {
return has_doc_;
- }
+ }
- void set_doc(const std::string& doc) {
- doc_ = doc;
- has_doc_ = true;
- }
+ void set_doc(const std::string& doc) {
+ doc_ = doc;
+ has_doc_ = true;
+ }
// This is not the same function as t_type::get_fingerprint_material,
// but it does the same thing.
@@ -132,8 +132,8 @@
bool xsd_nillable_;
t_struct* xsd_attrs_;
- std::string doc_;
- bool has_doc_;
+ std::string doc_;
+ bool has_doc_;
};