This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ARM-CGT: Type trait for trivially destructible types yields incorrect results

Part Number: ARM-CGT

The std::is_trivially_destructible<T> type trait incorrectly reports arrays of non-trivially-destructible types as being trivially destructible.

We're seeing this issue on both ARM-CGT 20.2.0 and C6000-ARM 8.3.8, and this minimal example should reproduce the issue:

#include <type_traits>

class C
{
  ~C() { /* non-trivial! */ }
};

static_assert(!std::is_trivially_destructible<C>::value, "");    // passes
static_assert(!std::is_trivially_destructible<C[5]>::value, ""); // fails (unexpectedly)

According to cppreference.com, both of these assertions should pass, which is also the case in GCC, for example.

  • Unfortunately, I am unable to reproduce the problem.  Please supply a complete source file that depends only on standard header files.  Also show all the build options exactly as the compiler sees them.

    Thanks and regards,

    -George

  • Ah, sorry. It seems I unintentionally swapped a keyword in the minimal example.

    This snippet reproduces the issue (notice the use of struct rather than class to declare C):

    #include <type_traits>

    struct C
    {
      ~C() { /* non-trivial! */ }
    };

    static_assert(!std::is_trivially_destructible<C>::value, "");    // passes
    static_assert(!std::is_trivially_destructible<C[5]>::value, ""); // fails (unexpectedly)

    When built using the following flags, the assertion on line 9 fails:

    armcl --compile_only --cpp_file=example.cpp -mv7M4 --c++14 --output_file=example.obj

    Regards,
    Simon

  • Thank you for submitting a concise test case.  I can reproduce the same behavior.  I filed EXT_EP-10332 to have this behavior investigated.  You are welcome to follow it with that link.

    Thanks and regards,

    -George