Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 5 years ago

Language

C++

Compiler

gcc 10.1.0

Options
Warnings
Boost 1.73.0
C++2a(GNU)
no pedantic

Author

anonymous

almost 5 years ago

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-10.1.0/include -std=gnu++2a
prog.cc: In function 'std::string passorFail(int, int)':
prog.cc:12:9: error: reference to 'count' is ambiguous
   12 |         count++;
      |         ^~~~~
In file included from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/string:52,
                 from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/locale_classes.h:40,
                 from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/ios_base.h:41,
                 from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/ios:42,
                 from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/ostream:38,
                 from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/iostream:39,
                 from prog.cc:1:
/opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/stl_algo.h:4077:5: note: candidates are: 'template<class _IIter, class _Tp> constexpr typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4077 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
prog.cc:4:5: note:                 'int count'
    4 | int count = 0;
      |     ^~~~~
prog.cc: In function 'int main()':
prog.cc:27:31: error: reference to 'count' is ambiguous
   27 |     std::cout << "Count: " << count << std::endl;
      |                               ^~~~~
In file included from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/string:52,
                 from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/locale_classes.h:40,
                 from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/ios_base.h:41,
                 from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/ios:42,
                 from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/ostream:38,
                 from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/iostream:39,
                 from prog.cc:1:
/opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/stl_algo.h:4077:5: note: candidates are: 'template<class _IIter, class _Tp> constexpr typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4077 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
prog.cc:4:5: note:                 'int count'
    4 | int count = 0;
      |     ^~~~~
Exit Code:
1