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

            Bug ID: 79243
           Summary: [7 Regression] Ambiguity with <string_view> and
                    versioned namespaces
           Product: gcc
           Version: 7.0.1
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

The following no longer compiles in C++17 mode:

#include <string>

int main()
{
  using namespace std::literals;
}



d.cc: In function ‘int main()’:
d.cc:5:24: error: reference to ‘literals’ is ambiguous
   using namespace std::literals;
                        ^~~~~~~~
In file included from /home/jwakely/gcc/so7/include/c++/7.0.1/string:38:0,
                 from d.cc:1:
/home/jwakely/gcc/so7/include/c++/7.0.1/x86_64-pc-linux-gnu/bits/c++config.h:290:20:
note: candidates are: namespace std::literals { }
   inline namespace literals {
                    ^~~~~~~~
In file included from
/home/jwakely/gcc/so7/include/c++/7.0.1/bits/basic_string.h:48:0,
                 from /home/jwakely/gcc/so7/include/c++/7.0.1/string:52,
                 from d.cc:1:
/home/jwakely/gcc/so7/include/c++/7.0.1/string_view:638:20: note:              
  namespace std::__7::literals { }
   inline namespace literals
                    ^~~~~~~~
d.cc:5:24: error: ‘literals’ is not a namespace-name
   using namespace std::literals;
                        ^~~~~~~~
d.cc:5:32: error: expected namespace-name before ‘;’ token
   using namespace std::literals;
                                ^

Reply via email to