]> granicus.if.org Git - clang/commit
[Sema] Fix built-in decrement operator overload resolution
authorJan Korous <jkorous@apple.com>
Wed, 11 Apr 2018 13:36:29 +0000 (13:36 +0000)
committerJan Korous <jkorous@apple.com>
Wed, 11 Apr 2018 13:36:29 +0000 (13:36 +0000)
commit6f411905a8b1beb109a8e2631151cf9f3306554a
tree456df72a3d71787915c3d4d745b957cd250d785f
parent378e40edd0141f64d690308cdfba071e87a2828b
[Sema] Fix built-in decrement operator overload resolution

C++ [over.built] p4:

"For every pair (T, VQ), where T is an arithmetic type other than bool, and VQ is either volatile or empty, there exist candidate operator functions of the form

  VQ T&      operator--(VQ T&);
  T          operator--(VQ T&, int);
"
The bool type is in position LastPromotedIntegralType in BuiltinOperatorOverloadBuilder::getArithmeticType::ArithmeticTypes, but addPlusPlusMinusMinusArithmeticOverloads() was expecting it at position 0.

Differential Revision: https://reviews.llvm.org/D44988

rdar://problem/34255516

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329804 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaOverload.cpp
test/SemaCXX/overloaded-builtin-operators.cpp