]> granicus.if.org Git - clang/commit
Built-in equality and relational operators have return type "bool" in C++,
authorDouglas Gregor <dgregor@apple.com>
Wed, 19 Nov 2008 03:25:36 +0000 (03:25 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 19 Nov 2008 03:25:36 +0000 (03:25 +0000)
commit447b69e55e1098d8df46dd99f171bfaace9ff8a0
tree5eb0bb0838c94e758fdf10aba2beb422fb00384b
parent2df37b8eaecc5382e0e511a738f88918f48d9454
Built-in equality and relational operators have return type "bool" in C++,
not "int".

Fix a typo in the promotion of enumeration types that was causing some
integral promotions to look like integral conversions (leading to
extra ambiguities in overload resolution).

Check for "acceptable" overloaded operators based on the types of the
arguments. This is a somewhat odd check that is specified by the
standard, but I can't see why it actually matters: the overload
candidates it suppresses don't seem like they would ever be picked as
the best candidates.

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