[Bug c++/125569] GCC treats a class with a deleted destructor as std::is_literal_type

"gongke at ios dot ac.cn via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125569

Ke Gong <gongke at ios dot ac.cn> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gongke at ios dot ac.cn

--- Comment #5 from Ke Gong <gongke at ios dot ac.cn> ---
I agree with @qurong.

Although the trait `std::is_literal_type` is gone in C++20, the concept of
"literal type" is still used, for example, for determining whether a type can
be used in a non-type template parameter.

Also note that the definition of "literal type" is different in C++20. As
[basic.types]/10 in N4659 (C++17) and N4861 (C++20), the destructor is required
to be *trivial* in C++17, but *constexpr* in C++20.

Look at this:

```cpp
struct NotLiteralCpp20 {
  ~NotLiteralCpp20() = delete;
};
template <NotLiteralCpp20 x>
struct Foo {};
```

This template parameter declaration should be ill-formed because
`NotLiteralCpp20` is not a literal type, but GCC accepts it.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.