[clang] [clang] Implement `__builtin_is_implicit_lifetime()` (PR #101807)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 11 12:02:33 PDT 2024


Endilll wrote:

> can you add tests for non aggregate with non elligible constructors and destructors ?

I don't think that a class with a destructor not eligible via requires clause is well-formed per http://eel.is/c++draft/class.dtor#4:
> At the end of the definition of a class, overload resolution is performed among the prospective destructors declared in that class with an empty argument list to select the [destructor](http://eel.is/c++draft/class.dtor#def:destructor) for the class, also known as the [selected destructor](http://eel.is/c++draft/class.dtor#def:destructor,selected)[.](http://eel.is/c++draft/class.dtor#4.sentence-1)
The program is ill-formed if overload resolution fails[.](http://eel.is/c++draft/class.dtor#4.sentence-2)
Destructor selection does not constitute a reference to, or odr-use ([[basic.def.odr]](http://eel.is/c++draft/basic.def.odr#term.odr.use)) of, the selected destructor, and in particular, the selected destructor may be deleted ([[dcl.fct.def.delete]](http://eel.is/c++draft/dcl.fct.def.delete))[.](http://eel.is/c++draft/class.dtor#4.sentence-3)

Note that GCC accepts such classes (erroneously in my opinion).

https://github.com/llvm/llvm-project/pull/101807


More information about the cfe-commits mailing list