r306809 - Ambiguity might be also uninitialized. Use llvm::Optional.
Vassil Vassilev via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 30 02:25:43 PDT 2017
Author: vvassilev
Date: Fri Jun 30 02:25:43 2017
New Revision: 306809
URL: http://llvm.org/viewvc/llvm-project?rev=306809&view=rev
Log:
Ambiguity might be also uninitialized. Use llvm::Optional.
Modified:
cfe/trunk/include/clang/Sema/Lookup.h
Modified: cfe/trunk/include/clang/Sema/Lookup.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Lookup.h?rev=306809&r1=306808&r2=306809&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Lookup.h (original)
+++ cfe/trunk/include/clang/Sema/Lookup.h Fri Jun 30 02:25:43 2017
@@ -18,6 +18,8 @@
#include "clang/AST/DeclCXX.h"
#include "clang/Sema/Sema.h"
+#include "llvm/ADT/Optional.h"
+
namespace clang {
/// @brief Represents the results of name lookup.
@@ -465,9 +467,10 @@ public:
Paths = nullptr;
}
} else {
- AmbiguityKind SavedAK = Ambiguity;
+ llvm::Optional<AmbiguityKind> SavedAK;
bool WasAmbiguous = false;
if (ResultKind == Ambiguous) {
+ SavedAK = Ambiguity;
WasAmbiguous = true;
}
ResultKind = Found;
@@ -478,7 +481,7 @@ public:
if (ResultKind == Ambiguous) {
(void)WasAmbiguous;
assert(WasAmbiguous);
- Ambiguity = SavedAK;
+ Ambiguity = SavedAK.getValue();
} else if (Paths) {
deletePaths(Paths);
Paths = nullptr;
More information about the cfe-commits
mailing list