public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/68133] New: constexpr basic_string_view(const _CharT* __str)
@ 2015-10-28 11:58 d.v.a at ngs dot ru
  2015-10-28 20:52 ` [Bug libstdc++/68133] " daniel.kruegler at googlemail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: d.v.a at ngs dot ru @ 2015-10-28 11:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68133

            Bug ID: 68133
           Summary: constexpr basic_string_view(const _CharT* __str)
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: d.v.a at ngs dot ru
  Target Milestone: ---

Compilation of this code:

#include<experimental/string_view>

int main()
{
    int arr[std::experimental::string_view("s").length()];
}

produces error:

error: ISO C++ forbids variable length array 'arr' [-Wvla]


Constructor's implementation:

      constexpr basic_string_view(const _CharT* __str)
      : _M_len{__str == nullptr ? 0 : traits_type::length(__str)},
        _M_str{__str}
      { }

But traits_type::length() isn't constexpr


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-10-31  6:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-28 11:58 [Bug libstdc++/68133] New: constexpr basic_string_view(const _CharT* __str) d.v.a at ngs dot ru
2015-10-28 20:52 ` [Bug libstdc++/68133] " daniel.kruegler at googlemail dot com
2015-10-29  6:02 ` d.v.a at ngs dot ru
2015-10-31  6:38 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).