From a715bdae7d7bc9941f5c7be57a11a0ff63e20db0 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 9 Oct 2026 11:46:32 -1000 Subject: [PATCH] Guard the _Znwj mangling and the exceptions setting at compile time --- esphome/components/esp32/operator_new.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/esphome/components/esp32/operator_new.cpp b/esphome/components/esp32/operator_new.cpp index 331b90e5040..7ea168b1ad0 100644 --- a/esphome/components/esp32/operator_new.cpp +++ b/esphome/components/esp32/operator_new.cpp @@ -12,8 +12,18 @@ #include #include +#include #include "esp_system.h" +#ifdef __cpp_exceptions +#error "CONFIG_COMPILER_CXX_EXCEPTIONS no longer matches -fexceptions" +#endif + +#ifndef CLANG_TIDY // clang-tidy parses Xtensa with a 64 bit host target +// --undefined=_Znwj in __init__.py relies on this mangling +static_assert(std::is_same_v, "update --undefined=_Znwj"); +#endif + namespace esphome::esp32 {} // namespace esphome::esp32 namespace {