Add a static_assert confirming that DiagnosticBuilder is small
authorReid Kleckner <rnk@google.com>
Thu, 24 Sep 2020 23:38:07 +0000 (16:38 -0700)
committerReid Kleckner <rnk@google.com>
Thu, 24 Sep 2020 23:38:41 +0000 (16:38 -0700)
clang/lib/Basic/Diagnostic.cpp

index 661eabf..c98fa6e 100644 (file)
@@ -40,6 +40,9 @@
 
 using namespace clang;
 
+static_assert(sizeof(DiagnosticBuilder) <= 2 * sizeof(void *),
+              "DiagnosticBuilder should be small, see class doc comments");
+
 const DiagnosticBuilder &clang::operator<<(const DiagnosticBuilder &DB,
                                            DiagNullabilityKind nullability) {
   StringRef string;