[libcxx-commits] [PATCH] D99789: [libc++] Add fallback standard flags and normalize corresponding feature.

Marek Kurdej via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Apr 6 12:20:25 PDT 2021


curdeius added inline comments.


================
Comment at: libcxx/utils/libcxx/test/params.py:57
             help="The version of the standard to compile the test suite with.",
-            default=lambda cfg: next(s for s in reversed(_allStandards) if hasCompileFlag(cfg, '-std='+s)),
+            default=lambda cfg: getLatestStdFlag(cfg)[1],
             actions=lambda std: [
----------------
ldionne wrote:
> curdeius wrote:
> > The default needs to be `[1]` because we don't want to use `-std=c++20` on the compiler that supports only `-std=c++2a`.
> It seems that we don't ever use `getLatestStdFlag(cfg)[0]` anymore, do we?
We don't indeed. Should I remove?


================
Comment at: libcxx/utils/libcxx/test/params.py:59
             actions=lambda std: [
-              AddFeature(std),
+              AddFeature(next((s for s, f in reversed(_allStandards.items()) if f == std), std)),
               AddCompileFlag('-std={}'.format(std)),
----------------
ldionne wrote:
> I don't understand the `if f == std` part -- isn't that always `False`?
`std` here can be the a fallback flag.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99789



More information about the libcxx-commits mailing list