[lld] [llvm] [clang] [libcxx] [lldb] [libc] [flang] [compiler-rt] [clang-tools-extra] [Clang][C++23] Implement P2448R2: Relaxing some constexpr restrictions (PR #77753)

Mariya Podchishchaeva via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 26 07:33:07 PST 2024


Fznamznon wrote:

> Oh gosh, I'm an idiot, i meant true

That makes it a little bit challenging to preserve old warnings for older versions of the language, without additional flags and options, in some cases like:
```
  struct A {
    ~A();
  };
  struct B : A {  };
  struct C {
    B a;
    constexpr ~C() {}
  };
```

So, when considering `~C`, it can be checked in `CheckConstexprDestructorSubobjects` that `B` has constexpr destructor and by the new rules it will, but there is no recursion there so `A` won't be checked and warning is lost. I'm not sure I want to add recursion to `CheckConstexprDestructorSubobjects`. Not sure about flags to CXXRecordDecl too.

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


More information about the cfe-commits mailing list