[cfe-commits] r160225 - in /cfe/trunk: lib/Sema/SemaDecl.cpp test/SemaCXX/warn-unique-enum.cpp
Eric Christopher
echristo at apple.com
Sat Jul 14 17:24:01 PDT 2012
Author: echristo
Date: Sat Jul 14 19:24:00 2012
New Revision: 160225
URL: http://llvm.org/viewvc/llvm-project?rev=160225&view=rev
Log:
Use llvm::APSInt::isSameValue to compare for the same value.
Finishes rdar://11875995
Modified:
cfe/trunk/lib/Sema/SemaDecl.cpp
cfe/trunk/test/SemaCXX/warn-unique-enum.cpp
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=160225&r1=160224&r2=160225&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Sat Jul 14 19:24:00 2012
@@ -10435,7 +10435,7 @@
continue;
}
- if (FirstVal != ECD->getInitVal())
+ if (!llvm::APSInt::isSameValue(FirstVal, ECD->getInitVal()))
return;
}
Modified: cfe/trunk/test/SemaCXX/warn-unique-enum.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/warn-unique-enum.cpp?rev=160225&r1=160224&r2=160225&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/warn-unique-enum.cpp (original)
+++ cfe/trunk/test/SemaCXX/warn-unique-enum.cpp Sat Jul 14 19:24:00 2012
@@ -19,3 +19,9 @@
enum I { I1 = H1, I2 = 4 };
enum J { J1 = 4, J2 = I2 };
enum K { K1, K2, K3, K4 };
+
+// Don't crash or warn on this one.
+// rdar://11875995
+enum L {
+ L1 = 0x8000000000000000ULL, L2 = 0x0000000000000001ULL
+};
More information about the cfe-commits
mailing list