Fix <rdar://problem/6703892> by not warning about self-comparisons of enum
constants.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67390 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/self-comparison.c b/test/Sema/self-comparison.c
index 023afb7..8bf54fd 100644
--- a/test/Sema/self-comparison.c
+++ b/test/Sema/self-comparison.c
@@ -23,3 +23,11 @@
int bar2(float x) {
return x != x; // no-warning
}
+
+// Motivated by <rdar://problem/6703892>, self-comparisons of enum constants
+// should not be warned about. These can be expanded from macros, and thus
+// are usually deliberate.
+int compare_enum() {
+ enum { A };
+ return A == A; // no-warning
+}