[libcxx-commits] [PATCH] D80452: [libc++] Complete overhaul of constexpr support in std::array

Fangrui Song via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri May 29 13:06:41 PDT 2020


MaskRay added a comment.

  #include <array>
  #include <string>
  
  int main() {
    std::array<std::string, 0> cells;
  }

>
=

  a.cc:5:30: error: call to implicitly-deleted default constructor of 'std::array<std::string, 0>' (aka 'array<basic_string<char, char_traits<char>, all
  ocator<char>>, 0>')
    std::array<std::string, 0> cells;
                               ^
  /tmp/ReleaseA/bin/../include/c++/v1/array:252:7: note: default constructor of 'array<std::__1::basic_string<char, std::__1::char_traits<char>, std::__
  1::allocator<char>>, 0>' is implicitly deleted because field '__w' has a deleted destructor
      } __w;                    
        ^                                                                                                                                               
  /tmp/ReleaseA/bin/../include/c++/v1/array:248:9: note: explicitly defaulted function was implicitly deleted here
          ~__wrapper() = default;
          ^
  /tmp/ReleaseA/bin/../include/c++/v1/array:251:13: note: destructor of '__wrapper' is implicitly deleted because variant field '__t' has a non-trivial 
  destructor                     
          _Tp __t;

`tensorflow/core/lib/monitoring/gauge.h` can have such a use case of 0 with certain instantiations.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80452





More information about the libcxx-commits mailing list