[flang-commits] [PATCH] D104779: [flang] Tweak the conditions for the GCC 7/libstdc++ workaround

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Jun 23 10:41:32 PDT 2021


klausler accepted this revision.
klausler added a comment.
This revision is now accepted and ready to land.

Thanks for improving this patch.



================
Comment at: flang/include/flang/Evaluate/type.h:145
   constexpr std::optional<std::int64_t> knownLength() const {
-#if !__clang__ && __GNUC__ == 7
+#if defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE == 7
     if (knownLength_ < 0) {
----------------
You don't need to check whether _GLIBCXX_RELEASE is defined; if it is not, it'll be replaced with 0 and the test will fail anyway.


================
Comment at: flang/include/flang/Evaluate/type.h:225
   const semantics::ParamValue *charLengthParamValue_{nullptr};
-#if !__clang__ && __GNUC__ == 7
+#if defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE == 7
   // GCC 7's optional<> lacks a constexpr operator=
----------------
Same here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104779



More information about the flang-commits mailing list