[libcxx-commits] [PATCH] D79555: [libc++] [C++20] [P0415] Constexpr for std::complex.

Marek Kurdej via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Mar 28 23:56:13 PDT 2021


curdeius added inline comments.


================
Comment at: libcxx/include/complex:739
+    return __lcpp_x < __lcpp_y ? __lcpp_y : __lcpp_x;
+  } else
+#endif // _LIBCPP_STD_VER > 17
----------------
Quuxplusone wrote:
> My impression is that you don't need these dangling `else`s (lines 739, 750, 777) for any C++ reason (like, the `else` on line 739 is not saving you from having to resolve and instantiate `fmax` on line 741). Do they improve codegen? If not, I say eliminate them — splitting unbraced control-flow structures across `#if/#endif` in this way is not-good. (Consider what happens if you replace line 741 with two lines of code, for example.)
Good catch. Eliminated.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79555



More information about the libcxx-commits mailing list