Skip to content

Comments

Fix C++11 build failure in destroy_at#88

Open
kiranj26 wants to merge 1 commit intoEmbedded-AMS:developfrom
kiranj26:codex/cpp11-clang-compat
Open

Fix C++11 build failure in destroy_at#88
kiranj26 wants to merge 1 commit intoEmbedded-AMS:developfrom
kiranj26:codex/cpp11-clang-compat

Conversation

@kiranj26
Copy link

@kiranj26 kiranj26 commented Feb 8, 2026

Summary

This fixes a C++11 compatibility issue in src/Defines.h.

In the C++11 code path, destroy_at was declared as:

  • constexpr void destroy_at(T* p)

With Apple Clang (C++11), this fails to compile because constexpr functions in C++11 cannot have void return type.

This change updates the C++11 overload to:

  • inline void destroy_at(T* p)

C++14 and C++17+ paths are unchanged.

Why this change

build_test.sh fails on C++11 toolchains due to the constexpr void declaration, which blocks normal development and CI on affected compilers.

Validation

  • Ran ./build_test.sh successfully after the change.
  • Ran ./build/test/test_EmbeddedProto successfully (155 tests passed).

Scope

  • Single-file, minimal change:
    • src/Defines.h

Issue

Closes #89

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant