Uploaded image for project: 'Embedded Software & Tools'
  1. Embedded Software & Tools
  2. EXT_EP-10332

std::is_trivially_destructible<array of non-trivially destructible> should return false

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • Code Generation Tools
    • CODEGEN-8789
    • Show
      https://e2e.ti.com/support/microcontrollers/other/f/other-microcontrollers-forum/993666/arm-cgt-type-trait-for-trivially-destructible-types-yields-incorrect-results
    • Hide
      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
      Show
      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
    • Hide
      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*
      Show
      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*
    • default

      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)
      

            syncuser TI User
            syncuser TI User
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: