names.cc: Add missing constinit (#1359)

```
external/upb/upbc/names.cc:49:25: error: 'constinit' specifier missing on initializing declaration of 'kRepeatedFieldArrayGetterPostfix' [-Werror,-Wmissing-constinit]
const absl::string_view kRepeatedFieldArrayGetterPostfix = "upb_array";
                        ^
ABSL_CONST_INIT
external/upb/upbc/names.h:64:1: note: variable declared constinit here
ABSL_CONST_INIT extern const absl::string_view kRepeatedFieldArrayGetterPostfix;
^
external/com_google_absl/absl/base/attributes.h:712:25: note: expanded from macro 'ABSL_CONST_INIT'
#define ABSL_CONST_INIT constinit
                        ^
external/upb/upbc/names.cc:50:25: error: 'constinit' specifier missing on initializing declaration of 'kRepeatedFieldMutableArrayGetterPostfix' [-Werror,-Wmissing-constinit]
const absl::string_view kRepeatedFieldMutableArrayGetterPostfix =
                        ^
ABSL_CONST_INIT
external/upb/upbc/names.h:65:1: note: variable declared constinit here
ABSL_CONST_INIT extern const absl::string_view
^
external/com_google_absl/absl/base/attributes.h:712:25: note: expanded from macro 'ABSL_CONST_INIT'
#define ABSL_CONST_INIT constinit
                        ^
```

Closes #1359

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/upb/pull/1359 from phallot:fix/missing-constinit 2029fef85ccf6dee5fcc2c9eea31dd38567fe893
PiperOrigin-RevId: 541940178
pull/13171/head
Pierre Hallot 2 years ago committed by Copybara-Service
parent 558c772b63
commit a93e43f7e8
  1. 7
      upbc/names.cc

@ -46,9 +46,10 @@ static constexpr absl::string_view kDeleteMethodPrefix = "delete_";
static constexpr absl::string_view kAddToRepeatedMethodPrefix = "add_";
static constexpr absl::string_view kResizeArrayMethodPrefix = "resize_";
const absl::string_view kRepeatedFieldArrayGetterPostfix = "upb_array";
const absl::string_view kRepeatedFieldMutableArrayGetterPostfix =
"mutable_upb_array";
ABSL_CONST_INIT const absl::string_view kRepeatedFieldArrayGetterPostfix =
"upb_array";
ABSL_CONST_INIT const absl::string_view
kRepeatedFieldMutableArrayGetterPostfix = "mutable_upb_array";
// List of generated accessor prefixes to check against.
// Example:

Loading…
Cancel
Save