This causes an error in clang, but GCC didn't report the error. There is a core language undefined behavior in the constexpr function: ``` struct A { constexpr ~A() {} }; constexpr int foo() { A a; a.~A(); return 0; } int main() { constexpr auto x = foo(); return x; } ``` Compiler Explorer link: https://godbolt.org/z/PMfv8G9ev This code compiles an error with Clang and MSVC.
Dup. *** This bug has been marked as a duplicate of bug 102284 ***