diff --git a/runtime/core/exec_aten/util/scalar_type_util.h b/runtime/core/exec_aten/util/scalar_type_util.h index d81b3ad4d0f..9df5d1e47a2 100644 --- a/runtime/core/exec_aten/util/scalar_type_util.h +++ b/runtime/core/exec_aten/util/scalar_type_util.h @@ -897,14 +897,14 @@ struct promote_types { #define ET_INTERNAL_SWITCH_CASE(enum_type, CTYPE_ALIAS, ...) \ case enum_type: { \ ET_INTERNAL_CHECK_SELECTIVE_BUILD(enum_type); \ - using CTYPE_ALIAS = \ + using CTYPE_ALIAS [[maybe_unused]] = \ ::executorch::runtime::ScalarTypeToCppType::type; \ return __VA_ARGS__(); \ } #else #define ET_INTERNAL_SWITCH_CASE(enum_type, CTYPE_ALIAS, ...) \ case enum_type: { \ - using CTYPE_ALIAS = \ + using CTYPE_ALIAS [[maybe_unused]] = \ ::executorch::runtime::ScalarTypeToCppType::type; \ return __VA_ARGS__(); \ }