[EXT_EP-10332] std::is_trivially_destructible<array of non-trivially destructible> should return false Created: 15/Apr/21  Updated: 09/May/24  Resolved: 07/Nov/23

Status: Fixed
Project: Embedded Software & Tools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: TI User Assignee: TI User
Resolution: Fixed Votes: 0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Product: Code Generation Tools
Internal ID: CODEGEN-8789
Forum URL: https://e2e.ti.com/support/microcontrollers/other/f/other-microcontrollers-forum/993666/arm-cgt-type-trait-for-trivially-destructible-types-yields-incorrect-results
Found In Release: C2000_22.6.0.LTS
C6000_8.3.0
MSP430_20.2.0.LTS
C7000_2.1.0.LTS
MSP430_21.6.0.LTS
C2000_21.6.0.LTS
PRU_2.3.0
C7000_3.1.0.LTS
ARM_20.2.0.LTS
Fix In Release: MSP430_20.2.8.LTS*
C7000_2.1.3.LTS*
MSP430_21.6.2.LTS*
C7000_3.1.1.LTS
C2000_22.6.2.LTS*
C6000_8.3.13
ARM_20.2.8.LTS*
C2000_NEXT*
PRU_2.3.4*
C2000_21.6.2.LTS*
Affected Platform/Device: default

 Description   

Consider a class C with a user-specified destructor. Because it has a user-specified destructor, it is not trivially destructible. An array of C is not trivially destructible because C is not. However, the parser gets the wrong value for std::is_trivially_destructible<T> when T is such an array:

#include <type_traits>
struct C { ~C() {  } };
static_assert(!std::is_trivially_destructible<C>::value, "");    // passes
static_assert(!std::is_trivially_destructible<C[5]>::value, ""); // fails (unexpectedly)

Generated at Mon Apr 14 10:16:47 CDT 2025 using Jira 9.12.17#9120017-sha1:aba4002bcd633f188b6a4bb5dd8a0e1f20b79ee4.