diff options
author | Vedant Kumar <vsk@apple.com> | 2018-06-26 03:53:06 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2018-06-26 03:53:06 +0000 |
commit | f5c66a1c4689e7b8f541e614ea42ccfa4182e622 (patch) | |
tree | 2e26f4355c083509a88a9f706e10b5268ae29f33 | |
parent | 910ba33d0c78bc8866a1939b255f91a5b4cd8eaa (diff) | |
download | bcm5719-llvm-f5c66a1c4689e7b8f541e614ea42ccfa4182e622.tar.gz bcm5719-llvm-f5c66a1c4689e7b8f541e614ea42ccfa4182e622.zip |
Fix an ambiguous overload issue pointed out by MSVC
Log:
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/11390
llvm-svn: 335577
-rw-r--r-- | clang/include/clang/Basic/Specifiers.h | 2 | ||||
-rw-r--r-- | clang/lib/Sema/SemaLambda.cpp | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/clang/include/clang/Basic/Specifiers.h b/clang/include/clang/Basic/Specifiers.h index c5edb5ea968..303b77e4480 100644 --- a/clang/include/clang/Basic/Specifiers.h +++ b/clang/include/clang/Basic/Specifiers.h @@ -296,7 +296,7 @@ namespace clang { /// Return true if \p L has a weaker nullability annotation than \p R. The /// ordering is: Unspecified < Nullable < NonNull. - inline bool operator<(NullabilityKind L, NullabilityKind R) { + inline bool hasWeakerNullability(NullabilityKind L, NullabilityKind R) { return uint8_t(L) > uint8_t(R); } diff --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp index 98b428b0899..fcacc2a17c9 100644 --- a/clang/lib/Sema/SemaLambda.cpp +++ b/clang/lib/Sema/SemaLambda.cpp @@ -712,7 +712,8 @@ void Sema::deduceClosureReturnType(CapturingScopeInfo &CSI) { auto RetTyNullability = ReturnType->getNullability(Ctx); auto BlockNullability = CSI.ReturnType->getNullability(Ctx); if (BlockNullability && - (!RetTyNullability || *RetTyNullability < *BlockNullability)) + (!RetTyNullability || + hasWeakerNullability(*RetTyNullability, *BlockNullability))) CSI.ReturnType = ReturnType; continue; } |