[libcxx-commits] [PATCH] D157741: [libc++][CI] Fixes error messages.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Aug 11 11:20:00 PDT 2023


Mordante created this revision.
Mordante added a reviewer: philnik.
Herald added a project: All.
Mordante requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157741

Files:
  libcxx/test/tools/clang_tidy_checks/header_exportable_declarations.cpp


Index: libcxx/test/tools/clang_tidy_checks/header_exportable_declarations.cpp
===================================================================
--- libcxx/test/tools/clang_tidy_checks/header_exportable_declarations.cpp
+++ libcxx/test/tools/clang_tidy_checks/header_exportable_declarations.cpp
@@ -38,15 +38,18 @@
       filename_(Options.get("Filename", "")),
       file_type_(Options.get("FileType", header_exportable_declarations::FileType::Unknown)),
       extra_header_(Options.get("ExtraHeader", "")) {
-  if (filename_.empty())
-    llvm::errs() << "No filename is provided.\n";
-
   switch (file_type_) {
   case header_exportable_declarations::FileType::Header:
-    /* DO NOTHING */
+    if (filename_.empty())
+      llvm::errs() << "No filename is provided.\n";
+    if (extra_header_.empty())
+      extra_header_ = "$^"; // Use a never matching regex to silence an error message.
     break;
-  case header_exportable_declarations::FileType::Module:
   case header_exportable_declarations::FileType::ModulePartition:
+    if (filename_.empty())
+      llvm::errs() << "No filename is provided.\n";
+    [[fallthrough]];
+  case header_exportable_declarations::FileType::Module:
     if (!extra_header_.empty())
       llvm::errs() << "Extra headers are not allowed for modules.\n";
     if (Options.get("SkipDeclarations"))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157741.549464.patch
Type: text/x-patch
Size: 1342 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230811/b2cb64fa/attachment.bin>


More information about the libcxx-commits mailing list