[PATCH] D149713: [Sema] Avoid emitting warnings for constant destruction.

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 3 09:55:16 PDT 2023


rsmith added a comment.

I think this would be an interesting test:

  struct S {
    /*not constexpr*/ S();
    constexpr ~S() {}
  };
  S s; // no warning
  
  struct T {
    /*not constexpr*/ T();
    constexpr ~T() { if (b) {} }
    bool b;
  };
  T t; // expected-warning {{exit-time destructor}}

(For a non-`constexpr` variable with a `constexpr` destructor, our behaviour depends on whether the destructor call is a constant expression.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149713/new/

https://reviews.llvm.org/D149713



More information about the cfe-commits mailing list