Commit Graph

6 Commits

Author SHA1 Message Date
Vivek Jain
655b9b6ef8 THRIFT-3921: Add ostream operator<< functions for enums (working with THRIFT-4060)
Client: C++

This closes #1083
This closes #1194
2017-02-18 14:30:46 -05:00
Jens Geyer
5eed3a161f THRIFT-3477 Parser fails on enum item that starts with 'E' letter and continues with number
Client: Compiler (general)
Patch: Jens Geyer
2015-12-08 21:05:52 +01:00
Nobuaki Sukegawa
ba3fe86b0a THRIFT-3464 Fix several defects in c_glib code generator
Client: c_glib compiler
Patch: Nobuaki Sukegawa

This closes #724
2015-12-06 10:11:16 +09:00
Roger Meier
cb0754db1e THRIFT-2784 Eliminate compiler warnings in generated C++ code
remove unused MyEnum5 and add -pedantic to lib/cpp/test/Makefile.am
2014-10-21 21:28:04 +02:00
Jens Geyer
86b309cde0 THRIFT-2513 clean up enum value assignment
Client: Compiler (General)
Patch: Jens Geyer
2014-09-12 00:23:51 +02:00
Jens Geyer
ae0b22cc29 THRIFT-2513 clean up enum value assignment
Patch: Dave Watson

This closes #88

Summary:
Clean up how enum values are handled if an integer value is not
explicitly specified in the thrift file.

For example, the following used to be a compile error, but
works now:

  enum MyEnum {
	SOMEVALUE
  }
  struct MyStruct {
	1: MyEnum e = SOMEVALUE
  }

This change also cleans up some of the error handling with out-of-range
values.  Previously thrift simply issued a warning for enum values that
didn't fit in an i32, but serialized them as i32 anyway.  Now
out-of-range enum values result in a compile failure.

Test Plan:
Included a new unit test to verify the assignment of enum values.  I
also verified that g++ makes the same enum value assignments when
compiling these enums as C++ code.
2014-09-04 23:40:14 +02:00