cplusplus / CWG

Core Working Group
23 stars 7 forks source link

CWG2807 [class.dtor] Destructors can, and shall not be consteval #420

Closed cor3ntin closed 7 months ago

cor3ntin commented 10 months ago

Issue description:

In [dcl.constexpr]/p2 we say,

A destructor, an allocation function, or a deallocation function shall not be declared with the consteval specifier.

Which seems entirely reasonable.

But in [class.dtor]/p1.2 we say

Each decl-specifier of the decl-specifier-seq of a prospective destructor declaration (if any) shall be friend, inline, virtual, constexpr, or consteval.

This is not as reasonable, and it is contradictory.

Suggested resolution:

Each decl-specifier of the decl-specifier-seq of a prospective destructor declaration (if any) shall be friend, inline, virtual, or constexpr, or consteval.

jensmaurer commented 9 months ago

CWG2807