[Bug libstdc++/79162] [7 Regression] [C++17] ambiguity in string assignment due to string_view overload

david.abdurachmanov at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Jun 2 18:31:00 GMT 2017


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

--- Comment #12 from David Abdurachmanov <david.abdurachmanov at gmail dot com> ---
I have attached minimized file (PGOInstrumentation.cpp) from LLVM.

Compile line: g++ -c PGOInstrumentation.cpp

Result:
PGOInstrumentation.cpp: In constructor
'{anonymous}::PGOInstrumentationUseLegacyPass::PGOInstrumentationUseLegacyPass(std::__cxx11::string)':
PGOInstrumentation.cpp:105:25: error: 'llvm::cl::opt<DataType, ExternalStorage,
ParserClass>::opt(const llvm::cl::opt<DataType, ExternalStorage, ParserClass>&)
[with DataType = std::__cxx11::basic_string<char>; bool ExternalStorage =
false; ParserClass = llvm::cl::parser<std::__cxx11::basic_string<char> >]' is
private within this context
       ProfileFileName = PGOTestProfileFile;
                         ^~~~~~~~~~~~~~~~~~
PGOInstrumentation.cpp:92:3: note: declared private here
   opt(const opt &) = delete;
   ^~~
PGOInstrumentation.cpp:105:25: error: use of deleted function
'llvm::cl::opt<DataType, ExternalStorage, ParserClass>::opt(const
llvm::cl::opt<DataType, ExternalStorage, ParserClass>&) [with DataType =
std::__cxx11::basic_string<char>; bool ExternalStorage = false; ParserClass =
llvm::cl::parser<std::__cxx11::basic_string<char> >]'
       ProfileFileName = PGOTestProfileFile;
                         ^~~~~~~~~~~~~~~~~~
PGOInstrumentation.cpp:92:3: note: declared here
   opt(const opt &) = delete;
   ^~~
PGOInstrumentation.cpp:72:2: note:   initializing argument 1 of
'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp,
std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&>
std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(_Tp) [with _Tp =
llvm::cl::opt<std::__cxx11::basic_string<char> >; _CharT = char; _Traits =
std::char_traits<char>; _Alloc = std::allocator<char>;
std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp,
std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> =
std::__cxx11::basic_string<char>&]'
  operator=(_Tp __sv)
  ^~~~~~~~


More information about the Gcc-bugs mailing list