Skip to content

Commit 86d01db

Browse files
Add missing "nonnull".
PiperOrigin-RevId: 892593444
1 parent 0aab4ce commit 86d01db

File tree

9 files changed

+150
-149
lines changed

9 files changed

+150
-149
lines changed

src/google/protobuf/compiler/cpp/message.cc

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,9 +1497,9 @@ void MessageGenerator::GenerateMapEntryClassDefinition(io::Printer* p) {
14971497
$pbi$::WireFormatLite::$val_wire_type$>;
14981498
$classname$();
14991499
template <typename = void>
1500-
explicit constexpr $classname$($pbi$::ConstantInitialized,
1501-
const $pbi$::ClassData* $nonnull$
1502-
class_data);
1500+
explicit constexpr $Msg$($pbi$::ConstantInitialized,
1501+
const $pbi$::ClassData* $nonnull$
1502+
class_data);
15031503
explicit $classname$($pb$::Arena* $nullable$ arena);
15041504
static constexpr const void* $nonnull$ internal_message_globals() {
15051505
return &_$classname$_globals_;
@@ -2179,9 +2179,9 @@ void MessageGenerator::GenerateClassDefinition(io::Printer* p) {
21792179
//~ Templatize constexpr constructor as a workaround for a bug in
21802180
//~ gcc 12 (warning in gcc 13).
21812181
template <typename = void>
2182-
explicit constexpr $classname$($pbi$::ConstantInitialized,
2183-
const $pbi$::ClassData* $nonnull$
2184-
class_data);
2182+
explicit constexpr $Msg$($pbi$::ConstantInitialized,
2183+
const $pbi$::ClassData* $nonnull$
2184+
class_data);
21852185
21862186
inline $classname$(const $classname$& from) : $classname$(nullptr, from) {}
21872187
inline $classname$($classname$&& from) noexcept
@@ -3068,27 +3068,28 @@ void MessageGenerator::GenerateConstexprConstructor(io::Printer* p) {
30683068
Formatter format(p);
30693069

30703070
if (IsMapEntryMessage(descriptor_) || !HasImplData(descriptor_, options_)) {
3071-
p->Emit({{"base",
3072-
[&] {
3073-
if (IsMapEntryMessage(descriptor_)) {
3074-
p->Emit("$classname$::MapEntry");
3075-
} else {
3076-
p->Emit("$superclass$");
3077-
}
3078-
}}},
3079-
R"cc(
3080-
//~ Templatize constexpr constructor as a workaround for a bug in
3081-
//~ gcc 12 (warning in gcc 13).
3082-
template <typename>
3083-
constexpr $Msg$::$Msg$(::_pbi::ConstantInitialized,
3084-
const ::_pbi::ClassData* class_data)
3085-
: $base$(
3071+
p->Emit(
3072+
{{"base",
3073+
[&] {
3074+
if (IsMapEntryMessage(descriptor_)) {
3075+
p->Emit("$classname$::MapEntry");
3076+
} else {
3077+
p->Emit("$superclass$");
3078+
}
3079+
}}},
3080+
R"cc(
3081+
//~ Templatize constexpr constructor as a workaround for a bug in
3082+
//~ gcc 12 (warning in gcc 13).
3083+
template <typename>
3084+
constexpr $Msg$::$Msg$(::_pbi::ConstantInitialized,
3085+
const ::_pbi::ClassData* $nonnull$ class_data)
3086+
: $base$(
30863087
#if defined(PROTOBUF_CUSTOM_VTABLE)
3087-
class_data
3088+
class_data
30883089
#endif // PROTOBUF_CUSTOM_VTABLE
3089-
) {
3090-
}
3091-
)cc");
3090+
) {
3091+
}
3092+
)cc");
30923093
return;
30933094
}
30943095

@@ -3110,7 +3111,7 @@ void MessageGenerator::GenerateConstexprConstructor(io::Printer* p) {
31103111
R"cc(
31113112
template <typename>
31123113
constexpr $Msg$::$Msg$(::_pbi::ConstantInitialized,
3113-
const ::_pbi::ClassData* class_data)
3114+
const ::_pbi::ClassData* $nonnull$ class_data)
31143115
: $superclass$(
31153116
#if defined(PROTOBUF_CUSTOM_VTABLE)
31163117
class_data

src/google/protobuf/compiler/java/java_features.pb.cc

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/google/protobuf/compiler/java/java_features.pb.h

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/google/protobuf/compiler/plugin.pb.cc

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/google/protobuf/compiler/plugin.pb.h

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/google/protobuf/cpp_features.pb.cc

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/google/protobuf/cpp_features.pb.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)