diff options
author | Jason Merrill <jason@redhat.com> | 2025-05-28 11:42:00 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2025-05-28 20:46:53 -0400 |
commit | 0629924777ea20d56d9ea40c3915eb0327a22ac7 (patch) | |
tree | d95d8a2935e191d6e0ab633937c23dd9f2e671ca /libjava/classpath/lib/java/sql | |
parent | 7fca794e0199baff8f07140a950ba3374c6aa634 (diff) | |
download | gcc-0629924777ea20d56d9ea40c3915eb0327a22ac7.zip gcc-0629924777ea20d56d9ea40c3915eb0327a22ac7.tar.gz gcc-0629924777ea20d56d9ea40c3915eb0327a22ac7.tar.bz2 |
c++: add __is_*destructible builtins [PR107600]
Typically "does this class have a trivial destructor" is the wrong question
to ask, we rather want "can I destroy this class trivially", thus the
std::is_trivially_destructible standard trait. Let's provide a builtin for
it, and complain about asking whether a deleted destructor is trivial.
Clang and MSVC also have these traits.
PR c++/107600
gcc/cp/ChangeLog:
* cp-trait.def (IS_DESTRUCTIBLE, IS_NOTHROW_DESTRUCTIBLE)
(IS_TRIVIALLY_DESTRUCTIBLE): New.
* constraint.cc (diagnose_trait_expr): Explain them.
* method.cc (destructible_expr): New.
(is_xible_helper): Use it.
* semantics.cc (finish_trait_expr): Handle new traits.
(trait_expr_value): Likewise. Complain about asking
whether a deleted dtor is trivial.
gcc/testsuite/ChangeLog:
* g++.dg/ext/is_destructible1.C: New test.
Diffstat (limited to 'libjava/classpath/lib/java/sql')
0 files changed, 0 insertions, 0 deletions