Skip to content

Commit 2c97fd4

Browse files
iahsfacebook-github-bot
authored andcommitted
Distinguish TSchemaAssociation for enums and structs with the same qualified name
Summary: There are lots of these pairs, resulting in duplicate definition errors. Differential Revision: D73522224 fbshipit-source-id: bf0fa9de97a9f1a85cc669786f752be526bde2c7
1 parent bd41e37 commit 2c97fd4

File tree

272 files changed

+1029
-1029
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

272 files changed

+1029
-1029
lines changed

third-party/thrift/src/thrift/compiler/generate/templates/cpp2/types/schema_association.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
}}
1818
{{! Declaration of `TSchemaAssociation` for the passed-in definition, the t_type `node`. }}
1919
{{#let export partial declaration |node|}}
20-
template <> struct TSchemaAssociation<{{node.cpp_qualified_underlying_name}}> {
20+
template <> struct TSchemaAssociation<{{node.cpp_qualified_underlying_name}}, {{node.enum?}}> {
2121
{{! This is a pointer to the generated schema bundle constant's accessor, to defer initialization of the data until we know it will be accessed. }}
2222
static ::folly::Range<const ::std::string_view*>(*bundle)();
2323
static constexpr int64_t programId = {{node.program.definition_key.buffer}};
@@ -27,7 +27,7 @@ template <> struct TSchemaAssociation<{{node.cpp_qualified_underlying_name}}> {
2727
2828
{{! Definition of `TSchemaAssociation` for the passed-in definition, the t_type `node`. }}
2929
{{#let export partial definition |node|}}
30-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<{{node.cpp_qualified_underlying_name}}>::bundle)() =
30+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<{{node.cpp_qualified_underlying_name}}, {{node.enum?}}>::bundle)() =
3131
{{#if node.program.schema_name}}
3232
&::{{node.program.cpp_qualified_namespace}}::{{node.program.name}}_constants::{{node.program.schema_name}}_includes;
3333
{{#else}}

third-party/thrift/src/thrift/compiler/test/fixtures/adapter/out/cpp2/gen-cpp2/AdapterService.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,6 @@ apache::thrift::ServiceRequestInfoMap AdapterServiceServiceInfoHolder::staticReq
319319
} // namespace facebook::thrift::test
320320

321321
namespace apache::thrift::detail {
322-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::AdapterService>::bundle)() =
322+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::AdapterService, false>::bundle)() =
323323
nullptr;
324324
}

third-party/thrift/src/thrift/compiler/test/fixtures/adapter/out/cpp2/gen-cpp2/AdapterService.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class ServiceHandler<::facebook::thrift::test::AdapterService> : public apache::
7676
};
7777

7878
namespace detail {
79-
template <> struct TSchemaAssociation<::facebook::thrift::test::AdapterService> {
79+
template <> struct TSchemaAssociation<::facebook::thrift::test::AdapterService, false> {
8080
static ::folly::Range<const ::std::string_view*>(*bundle)();
8181
static constexpr int64_t programId = 6075707212720674476;
8282
static constexpr ::std::string_view definitionKey = {"\x03\x9b\xff\xc3\x6a\xf9\xef\x06\x28\x55\x40\x94\x5b\xa1\x2c\xd7", 16};

third-party/thrift/src/thrift/compiler/test/fixtures/adapter/out/cpp2/gen-cpp2/Service.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,6 @@ apache::thrift::ServiceRequestInfoMap ServiceServiceInfoHolder::staticRequestInf
191191
} // namespace facebook::thrift::test
192192

193193
namespace apache::thrift::detail {
194-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::Service>::bundle)() =
194+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::Service, false>::bundle)() =
195195
nullptr;
196196
}

third-party/thrift/src/thrift/compiler/test/fixtures/adapter/out/cpp2/gen-cpp2/Service.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class ServiceHandler<::facebook::thrift::test::Service> : public apache::thrift:
6666
};
6767

6868
namespace detail {
69-
template <> struct TSchemaAssociation<::facebook::thrift::test::Service> {
69+
template <> struct TSchemaAssociation<::facebook::thrift::test::Service, false> {
7070
static ::folly::Range<const ::std::string_view*>(*bundle)();
7171
static constexpr int64_t programId = 6075707212720674476;
7272
static constexpr ::std::string_view definitionKey = {"\x76\x5a\x08\x5c\x43\xc7\x52\xaa\xee\xe7\x33\x50\xea\x5f\x81\x16", 16};

third-party/thrift/src/thrift/compiler/test/fixtures/adapter/out/cpp2/gen-cpp2/module_data.cpp

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -923,112 +923,112 @@ THRIFT_DATA_MEMBER const std::array<int, 1> TStructDataStorage<::facebook::thrif
923923

924924
namespace detail {
925925

926-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::MyAnnotation>::bundle)() =
926+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::MyAnnotation, false>::bundle)() =
927927
nullptr;
928928

929-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::Foo>::bundle)() =
929+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::Foo, false>::bundle)() =
930930
nullptr;
931931

932-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::Baz>::bundle)() =
932+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::Baz, false>::bundle)() =
933933
nullptr;
934934

935-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::Bar>::bundle)() =
935+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::Bar, false>::bundle)() =
936936
nullptr;
937937

938-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::detail::DirectlyAdapted>::bundle)() =
938+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::detail::DirectlyAdapted, false>::bundle)() =
939939
nullptr;
940940

941-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::detail::IndependentDirectlyAdapted>::bundle)() =
941+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::detail::IndependentDirectlyAdapted, false>::bundle)() =
942942
nullptr;
943943

944-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::StructWithFieldAdapter>::bundle)() =
944+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::StructWithFieldAdapter, false>::bundle)() =
945945
nullptr;
946946

947-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::TerseAdaptedFields>::bundle)() =
947+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::TerseAdaptedFields, false>::bundle)() =
948948
nullptr;
949949

950-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::B>::bundle)() =
950+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::B, false>::bundle)() =
951951
nullptr;
952952

953-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::A>::bundle)() =
953+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::A, false>::bundle)() =
954954
nullptr;
955955

956-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::Config>::bundle)() =
956+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::Config, false>::bundle)() =
957957
nullptr;
958958

959-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::MyStruct>::bundle)() =
959+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::MyStruct, false>::bundle)() =
960960
nullptr;
961961

962-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::AdaptTestStruct>::bundle)() =
962+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::AdaptTestStruct, false>::bundle)() =
963963
nullptr;
964964

965-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::AdaptTemplatedTestStruct>::bundle)() =
965+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::AdaptTemplatedTestStruct, false>::bundle)() =
966966
nullptr;
967967

968-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::AdaptTemplatedNestedTestStruct>::bundle)() =
968+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::AdaptTemplatedNestedTestStruct, false>::bundle)() =
969969
nullptr;
970970

971-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::ThriftAdaptTestUnion>::bundle)() =
971+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::ThriftAdaptTestUnion, false>::bundle)() =
972972
nullptr;
973973

974-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::ThriftAdaptedStruct>::bundle)() =
974+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::ThriftAdaptedStruct, false>::bundle)() =
975975
nullptr;
976976

977-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::detail::DirectlyAdaptedStruct>::bundle)() =
977+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::detail::DirectlyAdaptedStruct, false>::bundle)() =
978978
nullptr;
979979

980-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::StructFieldAdaptedStruct>::bundle)() =
980+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::StructFieldAdaptedStruct, false>::bundle)() =
981981
nullptr;
982982

983-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::CircularAdaptee>::bundle)() =
983+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::CircularAdaptee, false>::bundle)() =
984984
nullptr;
985985

986-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::CircularStruct>::bundle)() =
986+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::CircularStruct, false>::bundle)() =
987987
nullptr;
988988

989-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::ReorderedStruct>::bundle)() =
989+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::ReorderedStruct, false>::bundle)() =
990990
nullptr;
991991

992-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::detail::DeclaredAfterStruct>::bundle)() =
992+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::detail::DeclaredAfterStruct, false>::bundle)() =
993993
nullptr;
994994

995-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::UnderlyingRenamedStruct>::bundle)() =
995+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::UnderlyingRenamedStruct, false>::bundle)() =
996996
nullptr;
997997

998-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::UnderlyingSameNamespaceStruct>::bundle)() =
998+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::UnderlyingSameNamespaceStruct, false>::bundle)() =
999999
nullptr;
10001000

1001-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::detail::HeapAllocated>::bundle)() =
1001+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::detail::HeapAllocated, false>::bundle)() =
10021002
nullptr;
10031003

1004-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::MoveOnly>::bundle)() =
1004+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::MoveOnly, false>::bundle)() =
10051005
nullptr;
10061006

1007-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::AlsoMoveOnly>::bundle)() =
1007+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::AlsoMoveOnly, false>::bundle)() =
10081008
nullptr;
10091009

1010-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::ApplyAdapter>::bundle)() =
1010+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::ApplyAdapter, false>::bundle)() =
10111011
nullptr;
10121012

1013-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::detail::TransitiveAdapted>::bundle)() =
1013+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::detail::TransitiveAdapted, false>::bundle)() =
10141014
nullptr;
10151015

1016-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::CountingStruct>::bundle)() =
1016+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::CountingStruct, false>::bundle)() =
10171017
nullptr;
10181018

1019-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::Person>::bundle)() =
1019+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::Person, false>::bundle)() =
10201020
nullptr;
10211021

1022-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::Person2>::bundle)() =
1022+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::Person2, false>::bundle)() =
10231023
nullptr;
10241024

1025-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::Renamed>::bundle)() =
1025+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::Renamed, false>::bundle)() =
10261026
nullptr;
10271027

1028-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::Color>::bundle)() =
1028+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::Color, true>::bundle)() =
10291029
nullptr;
10301030

1031-
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::ThriftAdaptedEnum>::bundle)() =
1031+
::folly::Range<const ::std::string_view*>(*TSchemaAssociation<::facebook::thrift::test::ThriftAdaptedEnum, true>::bundle)() =
10321032
nullptr;
10331033

10341034
} // namespace detail

0 commit comments

Comments
 (0)