diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-10-10 14:05:31 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-10-10 14:05:31 +0000 |
commit | 877d4ebba49cc6b68cf8606d8192e2c23a2df4d7 (patch) | |
tree | 54d71bb438af50b9c7a49766494b50291bf99e96 /clang/lib/Sema/SemaOverload.cpp | |
parent | 3053586149fe18a89980587b35105bffe48ef5de (diff) | |
download | bcm5719-llvm-877d4ebba49cc6b68cf8606d8192e2c23a2df4d7.tar.gz bcm5719-llvm-877d4ebba49cc6b68cf8606d8192e2c23a2df4d7.zip |
Always add the built-in overload candidates for operators &&, ||, and
!. Fixes PR9865.
llvm-svn: 141537
Diffstat (limited to 'clang/lib/Sema/SemaOverload.cpp')
-rw-r--r-- | clang/lib/Sema/SemaOverload.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index c968498d00b..c931160f76c 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -6375,7 +6375,11 @@ Sema::AddBuiltinOperatorCandidates(OverloadedOperatorKind Op, // Exit early when no non-record types have been added to the candidate set // for any of the arguments to the operator. - if (!HasNonRecordCandidateType) + // + // We can't exit early for !, ||, or &&, since there we have always have + // 'bool' overloads. + if (!HasNonRecordCandidateType && + !(Op == OO_Exclaim || Op == OO_AmpAmp || Op == OO_PipePipe)) return; // Setup an object to manage the common state for building overloads. |