Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 6 years ago

Language

C++

Compiler

gcc HEAD 10.0.0 20190919 (experimental)

Options
Warnings
Don't Use Boost
C++2a(GNU)
no pedantic

Author

anonymous

over 6 years ago

$ g++ prog.cc -Wall -Wextra -std=gnu++2a
prog.cc: In function 'int main()':
prog.cc:12:16: error: 'Sort' was not declared in this scope
   12 |         s[i] = Sort(s[i], s[i+1]);
      |                ^~~~
prog.cc:18:43: error: no matching function for call to 'count(std::string&, std::string&)'
   18 |         cout << s[i] << count (s[i],s[i+1]) <<endl;
      |                                           ^
In file included from /opt/wandbox/gcc-head/include/c++/10.0.0/string:52,
                 from /opt/wandbox/gcc-head/include/c++/10.0.0/bits/locale_classes.h:40,
                 from /opt/wandbox/gcc-head/include/c++/10.0.0/bits/ios_base.h:41,
                 from /opt/wandbox/gcc-head/include/c++/10.0.0/ios:42,
                 from /opt/wandbox/gcc-head/include/c++/10.0.0/ostream:38,
                 from /opt/wandbox/gcc-head/include/c++/10.0.0/iostream:39,
                 from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/10.0.0/bits/stl_algo.h:4208:5: note: candidate: 'template<class _IIter, class _Tp> constexpr typename std::iterator_traits<_Iterator>::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4208 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
/opt/wandbox/gcc-head/include/c++/10.0.0/bits/stl_algo.h:4208:5: note:   template argument deduction/substitution failed:
prog.cc:18:43: note:   candidate expects 3 arguments, 2 provided
   18 |         cout << s[i] << count (s[i],s[i+1]) <<endl;
      |                                           ^
prog.cc: In function 'std::string Sort(std::string, std::string)':
prog.cc:33:1: warning: control reaches end of non-void function [-Wreturn-type]
   33 | }
      | ^
prog.cc: In function 'int count(std::string, std::string)':
prog.cc:43:1: warning: control reaches end of non-void function [-Wreturn-type]
   43 | }
      | ^
Exit Code:
1