https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125569

--- Comment #2 from qurong at ios dot ac.cn ---
I apologize for the lack of clarity in my initial submission and hope this
clarifies the situation. The behavior of literal types has changed from C++17
to C++20:

In C++17, a class with a destructor deleted on first declaration is still
considered trivial, and therefore the type qualifies as literal. GCC correctly
reflects this in C++17 mode.

In C++20, the definition of literal type requires that the destructor be
constexpr. Since NotLiteral has a deleted but non-constexpr destructor, it
should not be considered a literal type in C++20. Clang correctly rejects it
under C++20, while GCC currently treats it as literal, which seems inconsistent
with the C++20 standard.

The reproducer highlighting this C++20-specific issue is available here:
https://godbolt.org/z/1ssacrEcx

Therefore, the key point of this report is the discrepancy in C++20 behavior,
not C++17.

Reply via email to