Skip to content

Commit

Permalink
Shift cpp2 allocator members
Browse files Browse the repository at this point in the history
Summary: [Thrift] Shift cpp2 allocator members a bit further down in the class body.

Reviewed By: vitaut

Differential Revision: D23248215

fbshipit-source-id: cd652212ea4e90cc251b76849bf926646e52f477
  • Loading branch information
yfeldblum authored and facebook-github-bot committed Aug 21, 2020
1 parent 2d36401 commit 07f7124
Show file tree
Hide file tree
Showing 36 changed files with 486 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ class <%struct:name%> <%!
// using signed/unsigned as true/false for quicker parsing
using __fbthrift_cpp2_gen_json = <%^program:json?%>un<%/program:json?%>signed;
using __fbthrift_cpp2_gen_nimble = <%^program:nimble?%>un<%/program:nimble?%>signed;
public:
using __fbthrift_cpp2_type = <%struct:name%>;
<%#struct:cpp_allocator%>
public:
using allocator_type = <%struct:cpp_allocator%>;
Expand All @@ -95,7 +99,6 @@ class <%struct:name%> <%!
<%/struct:cpp_allocator%>

public:
using __fbthrift_cpp2_type = <%struct:name%>;
<%#struct:union?%>
<% > module_types_h/union_enum%>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ class MyStructNestedAnnotation final {
public:
using __fbthrift_cpp2_type = MyStructNestedAnnotation;


public:

THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
MyStructNestedAnnotation() {}
// FragileConstructor for use in initialization lists only.
Expand Down Expand Up @@ -289,6 +292,9 @@ class MyStructAnnotation final {
public:
using __fbthrift_cpp2_type = MyStructAnnotation;


public:

THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
MyStructAnnotation() :
count(0) {}
Expand Down Expand Up @@ -527,6 +533,9 @@ class MyStruct final {
public:
using __fbthrift_cpp2_type = MyStruct;


public:

MyStruct();
THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN

Expand Down Expand Up @@ -857,6 +866,9 @@ class SecretStruct final {
public:
using __fbthrift_cpp2_type = SecretStruct;


public:

THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
SecretStruct() :
id(0) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ class MyStruct final {
public:
using __fbthrift_cpp2_type = MyStruct;


public:

THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
MyStruct() :
myEnum(static_cast< ::test::fixtures::enumstrict::MyEnum>(0)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ class MyStruct final {
public:
using __fbthrift_cpp2_type = MyStruct;


public:

THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
MyStruct() :
MyIntField(0) {}
Expand Down
9 changes: 9 additions & 0 deletions thrift/compiler/test/fixtures/basic/gen-cpp2/module_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ class MyDataItem final {
public:
using __fbthrift_cpp2_type = MyDataItem;


public:

THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
MyDataItem() {}
// FragileConstructor for use in initialization lists only.
Expand Down Expand Up @@ -210,6 +213,9 @@ class MyStruct final {
public:
using __fbthrift_cpp2_type = MyStruct;


public:

THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
MyStruct() :
MyIntField(0),
Expand Down Expand Up @@ -442,6 +448,9 @@ class MyUnion final {

public:
using __fbthrift_cpp2_type = MyUnion;


public:
enum Type : int {
__EMPTY__ = 0,
myEnum = 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ class ComplexUnion final {

public:
using __fbthrift_cpp2_type = ComplexUnion;


public:
enum Type : int {
__EMPTY__ = 0,
intValue = 1,
Expand Down Expand Up @@ -739,6 +742,9 @@ class ListUnion final {

public:
using __fbthrift_cpp2_type = ListUnion;


public:
enum Type : int {
__EMPTY__ = 0,
intListValue = 2,
Expand Down Expand Up @@ -1032,6 +1038,9 @@ class DataUnion final {

public:
using __fbthrift_cpp2_type = DataUnion;


public:
enum Type : int {
__EMPTY__ = 0,
binaryData = 1,
Expand Down Expand Up @@ -1326,6 +1335,9 @@ class Val final {
public:
using __fbthrift_cpp2_type = Val;


public:

THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
Val() :
intVal(0) {}
Expand Down Expand Up @@ -1520,6 +1532,9 @@ class ValUnion final {

public:
using __fbthrift_cpp2_type = ValUnion;


public:
enum Type : int {
__EMPTY__ = 0,
v1 = 1,
Expand Down Expand Up @@ -1813,6 +1828,9 @@ class VirtualComplexUnion {

public:
using __fbthrift_cpp2_type = VirtualComplexUnion;


public:
enum Type : int {
__EMPTY__ = 0,
thingOne = 1,
Expand Down Expand Up @@ -2108,6 +2126,9 @@ class NonCopyableStruct final {
public:
using __fbthrift_cpp2_type = NonCopyableStruct;


public:

THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
NonCopyableStruct() :
num(0) {}
Expand Down Expand Up @@ -2219,6 +2240,9 @@ class NonCopyableUnion final {

public:
using __fbthrift_cpp2_type = NonCopyableUnion;


public:
enum Type : int {
__EMPTY__ = 0,
s = 1,
Expand Down
24 changes: 24 additions & 0 deletions thrift/compiler/test/fixtures/constants/gen-cpp2/module_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,9 @@ class Internship final {
public:
using __fbthrift_cpp2_type = Internship;


public:

THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
Internship() :
weeks(0),
Expand Down Expand Up @@ -492,6 +495,9 @@ class Range final {
public:
using __fbthrift_cpp2_type = Range;


public:

THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
Range() :
min(0),
Expand Down Expand Up @@ -630,6 +636,9 @@ class struct1 final {
public:
using __fbthrift_cpp2_type = struct1;


public:

THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
struct1() :
a(1234567),
Expand Down Expand Up @@ -790,6 +799,9 @@ class struct2 final {
public:
using __fbthrift_cpp2_type = struct2;


public:

THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
struct2() :
a(0) {}
Expand Down Expand Up @@ -1021,6 +1033,9 @@ class struct3 final {
public:
using __fbthrift_cpp2_type = struct3;


public:

THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
struct3() :
b(0) {}
Expand Down Expand Up @@ -1216,6 +1231,9 @@ class struct4 final {
public:
using __fbthrift_cpp2_type = struct4;


public:

THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
struct4() :
a(0),
Expand Down Expand Up @@ -1418,6 +1436,9 @@ class union1 final {

public:
using __fbthrift_cpp2_type = union1;


public:
enum Type : int {
__EMPTY__ = 0,
i = 1,
Expand Down Expand Up @@ -1683,6 +1704,9 @@ class union2 final {

public:
using __fbthrift_cpp2_type = union2;


public:
enum Type : int {
__EMPTY__ = 0,
i = 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ class Foo final {
public:
using __fbthrift_cpp2_type = Foo;


public:

THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
Foo() :
bar(0) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ class Foo final {
public:
using __fbthrift_cpp2_type = Foo;


public:

THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
Foo() :
bar(0) {}
Expand Down
3 changes: 3 additions & 0 deletions thrift/compiler/test/fixtures/doctext/gen-cpp2/module_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ class A final {
public:
using __fbthrift_cpp2_type = A;


public:

THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
A() :
useless_field(0) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ class Empty final {
public:
using __fbthrift_cpp2_type = Empty;


public:

THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
Empty() {}
// FragileConstructor for use in initialization lists only.
Expand Down Expand Up @@ -122,6 +125,9 @@ class Nada final {

public:
using __fbthrift_cpp2_type = Nada;


public:
enum Type : int {
__EMPTY__ = 0,
} ;
Expand Down
3 changes: 3 additions & 0 deletions thrift/compiler/test/fixtures/enums/gen-cpp2/module_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ class SomeStruct final {
public:
using __fbthrift_cpp2_type = SomeStruct;


public:

THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
SomeStruct() :
reasonable( ::cpp2::Metasyntactic::FOO),
Expand Down
15 changes: 15 additions & 0 deletions thrift/compiler/test/fixtures/exceptions/gen-cpp2/module_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ class Banal final : public apache::thrift::TException {
public:
using __fbthrift_cpp2_type = Banal;


public:

THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
Banal() {}
// FragileConstructor for use in initialization lists only.
Expand Down Expand Up @@ -160,6 +163,9 @@ class Fiery final : public apache::thrift::TException {
public:
using __fbthrift_cpp2_type = Fiery;


public:

THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
Fiery() {}

Expand Down Expand Up @@ -281,6 +287,9 @@ class Serious final : public apache::thrift::TException {
public:
using __fbthrift_cpp2_type = Serious;


public:

THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
Serious() {}

Expand Down Expand Up @@ -413,6 +422,9 @@ class ComplexFieldNames final : public apache::thrift::TException {
public:
using __fbthrift_cpp2_type = ComplexFieldNames;


public:

THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
ComplexFieldNames() {}

Expand Down Expand Up @@ -586,6 +598,9 @@ class CustomFieldNames final : public apache::thrift::TException {
public:
using __fbthrift_cpp2_type = CustomFieldNames;


public:

THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
CustomFieldNames() {}

Expand Down
Loading

0 comments on commit 07f7124

Please sign in to comment.