Skip to content

Commit 1ba5192

Browse files
Disable HasConstexprDefaultConstructor for Xtensa.
PiperOrigin-RevId: 842863213
1 parent 5e5a8c9 commit 1ba5192

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/google/protobuf/port.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,11 +800,12 @@ class alignas(8) GlobalEmptyStringConstexpr {
800800
// Nothing to init, or destroy.
801801
std::string* Init() const { return nullptr; }
802802

803-
// Disable the optimization for MSVC.
803+
// Disable the optimization for MSVC and Xtensa.
804804
// There are some builds where the default constructed string can't be used as
805805
// `constinit` even though the constructor is `constexpr` and can be used
806806
// during constant evaluation.
807-
#if !defined(_MSC_VER)
807+
#if !defined(_MSC_VER) && !defined(__XTENSA__)
808+
// Compilation fails on Xtensa: b/467129751
808809
template <typename T = std::string, bool = (T(), true)>
809810
static constexpr std::true_type HasConstexprDefaultConstructor(int) {
810811
return {};

0 commit comments

Comments
 (0)