c++: Don't add built-in operator for ++ on bool.
authorMarek Polacek <polacek@redhat.com>
Fri, 15 May 2020 14:59:01 +0000 (10:59 -0400)
committerMarek Polacek <polacek@redhat.com>
Mon, 18 May 2020 19:50:12 +0000 (15:50 -0400)
commit100fdb1f09b484ef100b638b28a260857d85f9dd
tree843472f613abf74a1cb577886e164f7e1550a5c5
parent642dc602f89b2c11d5d833a52f37b04427a27cab
c++: Don't add built-in operator for ++ on bool.

This feels extremely obscure but at least it's an opportunity to fix the
comments.  P0002R1 removed deprecated operator++(bool) in C++17 so let's
avoid adding a builtin overload candidate for ++ when the type is bool.

* call.c (add_builtin_candidate): Don't create a builtin overload
candidate for ++ when type is bool in C++17.

* g++.dg/overload/builtin5.C: New test.
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/overload/builtin5.C [new file with mode: 0644]