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

            Bug ID: 91120
           Summary: broken template instantiation for std::string_view
                    values
           Product: gcc
           Version: 9.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: development at jordi dot vilar.cat
  Target Milestone: ---

The following code fails to compile with gcc 9.1 and -std=c++2a:

#include <string_view>
using namespace std::string_view_literals;

template<std::string_view> struct test_type {};

auto test = test_type<""sv>{};

reporting the following diagnostics message:
error: '""' is not a valid template argument of type 'const char*' because '""'
is not a variable

using other literal types (integral types, std::array, etc.) seems to work.

Reply via email to