Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

about 6 years ago

Language

C++

Compiler

gcc HEAD 9.0.1 20190419 (experimental)

Options
Warnings
Optimization
Don't Use Boost
C++2a
no pedantic
Raw compiler options
-pedantic -pthread

Author

anonymous

about 6 years ago

$ g++ prog.cc -Wall -Wextra -O2 -march=native -std=c++2a -pedantic -pthread
prog.cc: In function 'int main()':
prog.cc:12:9: error: ambiguous overload for 'operator=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'Foo')
   12 |   bar = foo;
      |         ^~~
In file included from /opt/wandbox/gcc-head/include/c++/9.0.1/string:55,
                 from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/9.0.1/bits/basic_string.h:665:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  665 |       operator=(const basic_string& __str)
      |       ^~~~~~~~
/opt/wandbox/gcc-head/include/c++/9.0.1/bits/basic_string.h:715:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  715 |       operator=(_CharT __c)
      |       ^~~~~~~~
Exit Code:
1