[libcxx-commits] [PATCH] D102119: [libcxx][optional] adds missing constexpr operations

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 9 09:51:10 PDT 2021


Quuxplusone added inline comments.


================
Comment at: libcxx/test/support/archetypes.h:56
 
-    static void reset_constructors() {
+    TEST_CONSTEXPR_CXX20 static void reset_constructors() {
       constructed = value_constructed = default_constructed =
----------------
Style nit 1: `static TEST_CONSTEXPR_CXX20 void`
Correctness nit 2: None of these functions that touch static members like `alive` and `constructed` can actually be constexpr in C++20. Constexpr functions aren't allowed to modify (or even read) global data. Therefore, adding `TEST_CONSTEXPR_CXX20` to all these functions is really just noise; you could remove it and simplify this patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102119



More information about the libcxx-commits mailing list