Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 6 years ago

Language

C++

Compiler

gcc 8.2.0

Options
Warnings
Boost 1.68.0
C++2a(GNU)
no pedantic
Raw compiler options
-Werror

Author

anonymous

over 6 years ago

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.68.0/gcc-8.2.0/include -std=gnu++2a -Werror
prog.cc: In function 'int main()':
prog.cc:20:6: error: request for member 'operator++' is ambiguous
     d++;
      ^~
prog.cc:10:9: note: candidates are: 'int Post::operator++(int)'
     int operator++(int) noexcept { return x; }
         ^~~~~~~~
prog.cc:4:11: note:                 'int& Pre::operator++()'
     int & operator++() noexcept { return x; }
           ^~~~~~~~
prog.cc:21:7: error: request for member 'operator++' is ambiguous
     ++d;
       ^
prog.cc:10:9: note: candidates are: 'int Post::operator++(int)'
     int operator++(int) noexcept { return x; }
         ^~~~~~~~
prog.cc:4:11: note:                 'int& Pre::operator++()'
     int & operator++() noexcept { return x; }
           ^~~~~~~~
Exit Code:
1