[flang-commits] [PATCH] D103571: [flang] Support known constant lengths in DynamicType

Martin Storsjö via Phabricator via flang-commits flang-commits at lists.llvm.org
Tue Jun 22 04:35:58 PDT 2021


mstorsjo added a comment.

FYI, this change broke compiling flang with GCC 7 on Ubuntu 18.04, with build errors like these:

  In file included from /home/ubuntu/code/llvm-project/flang/include/flang/Evaluate/call.h:12:0,
                   from /home/ubuntu/code/llvm-project/flang/include/flang/Evaluate/intrinsics.h:12,
                   from /home/ubuntu/code/llvm-project/flang/lib/Evaluate/intrinsics.cpp:9:
  /home/ubuntu/code/llvm-project/flang/include/flang/Evaluate/common.h:187:16: error: explicitly defaulted function ‘constexpr Fortran::evaluate::DynamicType& Fortran::evaluate::DynamicType::operator=(const Fortran::evaluate::DynamicType&)’ cannot be declared as constexpr because the implicit declaration is not constexpr:
     constexpr t &operator=(const t &) = default; \
                  ^
  /home/ubuntu/code/llvm-project/flang/include/flang/Evaluate/type.h:103:3: note: in expansion of macro ‘CONSTEXPR_CONSTRUCTORS_AND_ASSIGNMENTS’
     CONSTEXPR_CONSTRUCTORS_AND_ASSIGNMENTS(DynamicType)
     ^
  In file included from /usr/include/c++/7/bits/node_handle.h:39:0,
                   from /usr/include/c++/7/bits/hashtable.h:37,
                   from /usr/include/c++/7/unordered_map:47,
                   from /usr/include/c++/7/functional:60,
                   from /home/ubuntu/code/llvm-project/flang/include/flang/Common/idioms.h:27,
                   from /home/ubuntu/code/llvm-project/flang/include/flang/Common/Fortran.h:15,
                   from /home/ubuntu/code/llvm-project/flang/include/flang/Evaluate/common.h:12,
                   from /home/ubuntu/code/llvm-project/flang/include/flang/Evaluate/call.h:12,
                   from /home/ubuntu/code/llvm-project/flang/include/flang/Evaluate/intrinsics.h:12,
                   from /home/ubuntu/code/llvm-project/flang/lib/Evaluate/intrinsics.cpp:9:
  /usr/include/c++/7/optional:453:11: note: defaulted constructor calls non-constexpr ‘std::optional<long int>& std::optional<long int>::operator=(const std::optional<long int>&)’
       class optional
             ^~~~~~~~
  /usr/include/c++/7/optional:453:11: note: ‘std::optional<long int>& std::optional<long int>::operator=(const std::optional<long int>&)’ is not usable as a constexpr function because:
  /usr/include/c++/7/optional:351:7: note: defaulted constructor calls non-constexpr ‘std::_Optional_base<_Tp>& std::_Optional_base<_Tp>::operator=(const std::_Optional_base<_Tp>&) [with _Tp = long int]’
         operator=(const _Optional_base& __other)
         ^~~~~~~~


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103571



More information about the flang-commits mailing list