Change all self assignments X=X to (void)X, so that we can turn on a
new gcc warning that complains on self-assignments and
self-initializations. Fix one bug found by the warning, in which one
clang::OverloadCandidate constructor failed to initialize its
FunctionTemplate member.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122459 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/GR/Checkers/ExprEngine.cpp b/lib/GR/Checkers/ExprEngine.cpp
index e7048ef..6e82504 100644
--- a/lib/GR/Checkers/ExprEngine.cpp
+++ b/lib/GR/Checkers/ExprEngine.cpp
@@ -1373,7 +1373,7 @@
// Sanity checks. These go away in Release builds.
assert(b && V1.Val.isInt() && !V1.HasSideEffects
&& "Case condition must evaluate to an integer constant.");
- b = b; // silence unused variable warning
+ (void)b; // silence unused variable warning
assert(V1.Val.getInt().getBitWidth() ==
getContext().getTypeSize(CondE->getType()));
@@ -1384,7 +1384,7 @@
b = E->Evaluate(V2, getContext());
assert(b && V2.Val.isInt() && !V2.HasSideEffects
&& "Case condition must evaluate to an integer constant.");
- b = b; // silence unused variable warning
+ (void)b; // silence unused variable warning
}
else
V2 = V1;