[PATCH] D13500: Improve helpfulness of assert message when number of diagnostics overflows number of available enum values.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 9 12:46:15 PDT 2015


rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.

It'd be great if we could check this during compilation somehow. But anyway, LGTM.


================
Comment at: lib/Basic/DiagnosticIDs.cpp:104
@@ -103,3 +103,3 @@
     for (unsigned i = 1; i != StaticDiagInfoSize; ++i) {
-      assert(StaticDiagInfo[i-1].DiagID != StaticDiagInfo[i].DiagID &&
+      assert(StaticDiagInfo[i-1].DiagID < StaticDiagInfo[i].DiagID &&
              "Diag ID conflict, the enums at the start of clang::diag (in "
----------------
Maybe drop the `.DiagID`s here?


http://reviews.llvm.org/D13500





More information about the cfe-commits mailing list