[PATCH] D111400: [Clang] Implement P2242R3

Corentin Jabot via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 5 05:46:30 PST 2021


cor3ntin added a comment.

Regression compared to the status quo:
This code no longer warns (as noted by Hubert above)

  auto f = [](bool b) {
    if (b) return 42;
    static int x = 0;
    return x;
  };
  constexpr int x = f(true);
  const int *p = &x;

GCC doesn't warn and... if we wanted to produce a warning there, I have no idea how to go about it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111400



More information about the cfe-commits mailing list