[libcxx-commits] [PATCH] D110347: [libc++] Do not enable P1951 before C++23, since it's a breaking change

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Sep 27 10:18:36 PDT 2021


ldionne added inline comments.


================
Comment at: libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.brace-init.P1951.pass.cpp:34-35
+        int i = 0;
+        auto f = [&](std::pair<std::vector<int>, const A&>) { assert(i >= 1); };
+        f({{42, 43}, &i});
+    }
----------------
Quuxplusone wrote:
> LGTM, although of course you could replace `vector<int>` with `int` and/or `{42,43}` with `{}` if you wanted to simplify it a bit.
(I think this comment does not appear on the right line).

Actually, if you do that, Clang starts diagnosing that we're binding a temporary beyond its lifetime. That *sounds* like a false-positive to me.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110347



More information about the libcxx-commits mailing list