Skip to content

Revert "[clang-tidy] Add new check readability-use-numeric-limits" #145355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

vbvictor
Copy link
Contributor

@vbvictor vbvictor commented Jun 23, 2025

Reverts #127430 due to stable asan buildbot failures: https://lab.llvm.org/buildbot/#/builders/169

@llvmbot
Copy link
Member

llvmbot commented Jun 23, 2025

@llvm/pr-subscribers-clang-tools-extra

@llvm/pr-subscribers-clang-tidy

Author: Baranov Victor (vbvictor)

Changes

Reverts llvm/llvm-project#127430 due to asan buildbot failures: https://lab.llvm.org/buildbot/#/builders/169/builds/12435


Full diff: https://github.com/llvm/llvm-project/pull/145355.diff

8 Files Affected:

  • (modified) clang-tools-extra/clang-tidy/readability/CMakeLists.txt (-1)
  • (modified) clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp (-3)
  • (removed) clang-tools-extra/clang-tidy/readability/UseNumericLimitsCheck.cpp (-160)
  • (removed) clang-tools-extra/clang-tidy/readability/UseNumericLimitsCheck.h (-38)
  • (modified) clang-tools-extra/docs/ReleaseNotes.rst (-6)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/list.rst (-1)
  • (removed) clang-tools-extra/docs/clang-tidy/checks/readability/use-numeric-limits.rst (-31)
  • (removed) clang-tools-extra/test/clang-tidy/checkers/readability/use-numeric-limits.cpp (-100)
diff --git a/clang-tools-extra/clang-tidy/readability/CMakeLists.txt b/clang-tools-extra/clang-tidy/readability/CMakeLists.txt
index 2c40a863c5b7d..4be1a8f831339 100644
--- a/clang-tools-extra/clang-tidy/readability/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/readability/CMakeLists.txt
@@ -58,7 +58,6 @@ add_clang_library(clangTidyReadabilityModule STATIC
   UniqueptrDeleteReleaseCheck.cpp
   UppercaseLiteralSuffixCheck.cpp
   UseAnyOfAllOfCheck.cpp
-  UseNumericLimitsCheck.cpp
   UseStdMinMaxCheck.cpp
 
   LINK_LIBS
diff --git a/clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp b/clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp
index dc47c2fb31937..d59b0312673b9 100644
--- a/clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp
@@ -61,7 +61,6 @@
 #include "UniqueptrDeleteReleaseCheck.h"
 #include "UppercaseLiteralSuffixCheck.h"
 #include "UseAnyOfAllOfCheck.h"
-#include "UseNumericLimitsCheck.h"
 #include "UseStdMinMaxCheck.h"
 
 namespace clang::tidy {
@@ -174,8 +173,6 @@ class ReadabilityModule : public ClangTidyModule {
         "readability-uppercase-literal-suffix");
     CheckFactories.registerCheck<UseAnyOfAllOfCheck>(
         "readability-use-anyofallof");
-    CheckFactories.registerCheck<UseNumericLimitsCheck>(
-        "readability-use-numeric-limits");
     CheckFactories.registerCheck<UseStdMinMaxCheck>(
         "readability-use-std-min-max");
   }
diff --git a/clang-tools-extra/clang-tidy/readability/UseNumericLimitsCheck.cpp b/clang-tools-extra/clang-tidy/readability/UseNumericLimitsCheck.cpp
deleted file mode 100644
index 334b69755db29..0000000000000
--- a/clang-tools-extra/clang-tidy/readability/UseNumericLimitsCheck.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-//===--- UseNumericLimitsCheck.cpp - clang-tidy ---------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#include "UseNumericLimitsCheck.h"
-#include "clang/AST/ASTContext.h"
-#include "clang/ASTMatchers/ASTMatchFinder.h"
-#include "clang/Lex/Preprocessor.h"
-#include <cmath>
-#include <limits>
-
-using namespace clang::ast_matchers;
-
-namespace clang::tidy::readability {
-
-UseNumericLimitsCheck::UseNumericLimitsCheck(StringRef Name,
-                                             ClangTidyContext *Context)
-    : ClangTidyCheck(Name, Context),
-      SignedConstants{
-          {std::numeric_limits<int8_t>::min(),
-           "std::numeric_limits<int8_t>::min()"},
-          {std::numeric_limits<int8_t>::max(),
-           "std::numeric_limits<int8_t>::max()"},
-          {std::numeric_limits<int16_t>::min(),
-           "std::numeric_limits<int16_t>::min()"},
-          {std::numeric_limits<int16_t>::max(),
-           "std::numeric_limits<int16_t>::max()"},
-          {std::numeric_limits<int32_t>::min(),
-           "std::numeric_limits<int32_t>::min()"},
-          {std::numeric_limits<int32_t>::max(),
-           "std::numeric_limits<int32_t>::max()"},
-          {std::numeric_limits<int64_t>::min(),
-           "std::numeric_limits<int64_t>::min()"},
-          {std::numeric_limits<int64_t>::max(),
-           "std::numeric_limits<int64_t>::max()"},
-      },
-      UnsignedConstants{
-          {std::numeric_limits<uint8_t>::max(),
-           "std::numeric_limits<uint8_t>::max()"},
-          {std::numeric_limits<uint16_t>::max(),
-           "std::numeric_limits<uint16_t>::max()"},
-          {std::numeric_limits<uint32_t>::max(),
-           "std::numeric_limits<uint32_t>::max()"},
-          {std::numeric_limits<uint64_t>::max(),
-           "std::numeric_limits<uint64_t>::max()"},
-      },
-      Inserter(Options.getLocalOrGlobal("IncludeStyle",
-                                        utils::IncludeSorter::IS_LLVM),
-               areDiagsSelfContained()) {}
-
-void UseNumericLimitsCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
-  Options.store(Opts, "IncludeStyle", Inserter.getStyle());
-}
-
-void UseNumericLimitsCheck::registerMatchers(MatchFinder *Finder) {
-  auto PositiveIntegerMatcher = [](auto Value) {
-    return unaryOperator(hasOperatorName("+"),
-                         hasUnaryOperand(integerLiteral(equals(Value))
-                                             .bind("positive-integer-literal")))
-        .bind("unary-op");
-  };
-
-  auto NegativeIntegerMatcher = [](auto Value) {
-    return unaryOperator(hasOperatorName("-"),
-                         hasUnaryOperand(integerLiteral(equals(-Value))
-                                             .bind("negative-integer-literal")))
-        .bind("unary-op");
-  };
-
-  auto BareIntegerMatcher = [](auto Value) {
-    return integerLiteral(allOf(unless(hasParent(unaryOperator(
-                                    hasAnyOperatorName("-", "+")))),
-                                equals(Value)))
-        .bind("bare-integer-literal");
-  };
-
-  for (const auto &[Value, _] : SignedConstants) {
-    if (Value < 0) {
-      Finder->addMatcher(NegativeIntegerMatcher(Value), this);
-    } else {
-      Finder->addMatcher(
-          expr(anyOf(PositiveIntegerMatcher(Value), BareIntegerMatcher(Value))),
-          this);
-    }
-  }
-
-  for (const auto &[Value, _] : UnsignedConstants) {
-    Finder->addMatcher(
-        expr(anyOf(PositiveIntegerMatcher(Value), BareIntegerMatcher(Value))),
-        this);
-  }
-}
-
-void UseNumericLimitsCheck::registerPPCallbacks(
-    const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) {
-  Inserter.registerPreprocessor(PP);
-}
-
-void UseNumericLimitsCheck::check(const MatchFinder::MatchResult &Result) {
-  const IntegerLiteral *MatchedDecl = nullptr;
-
-  const IntegerLiteral *NegativeMatchedDecl =
-      Result.Nodes.getNodeAs<IntegerLiteral>("negative-integer-literal");
-  const IntegerLiteral *PositiveMatchedDecl =
-      Result.Nodes.getNodeAs<IntegerLiteral>("positive-integer-literal");
-  const IntegerLiteral *BareMatchedDecl =
-      Result.Nodes.getNodeAs<IntegerLiteral>("bare-integer-literal");
-
-  if (NegativeMatchedDecl != nullptr)
-    MatchedDecl = NegativeMatchedDecl;
-  else if (PositiveMatchedDecl != nullptr)
-    MatchedDecl = PositiveMatchedDecl;
-  else if (BareMatchedDecl != nullptr)
-    MatchedDecl = BareMatchedDecl;
-
-  const llvm::APInt MatchedIntegerConstant = MatchedDecl->getValue();
-
-  auto Fixer = [&](auto SourceValue, auto Value,
-                   const std::string &Replacement) {
-    static_assert(std::is_same_v<decltype(SourceValue), decltype(Value)>,
-                  "The types of SourceValue and Value must match");
-
-    SourceLocation Location = MatchedDecl->getExprLoc();
-    SourceRange Range{MatchedDecl->getBeginLoc(), MatchedDecl->getEndLoc()};
-
-    // Only valid if unary operator is present
-    const UnaryOperator *UnaryOpExpr =
-        Result.Nodes.getNodeAs<UnaryOperator>("unary-op");
-
-    if (MatchedDecl == NegativeMatchedDecl && -SourceValue == Value) {
-      Range = SourceRange(UnaryOpExpr->getBeginLoc(), UnaryOpExpr->getEndLoc());
-      Location = UnaryOpExpr->getExprLoc();
-      SourceValue = -SourceValue;
-    } else if (MatchedDecl == PositiveMatchedDecl && SourceValue == Value) {
-      Range = SourceRange(UnaryOpExpr->getBeginLoc(), UnaryOpExpr->getEndLoc());
-      Location = UnaryOpExpr->getExprLoc();
-    } else if (MatchedDecl != BareMatchedDecl || SourceValue != Value) {
-      return;
-    }
-
-    diag(Location,
-         "the constant '%0' is being utilized; consider using '%1' instead")
-        << SourceValue << Replacement
-        << FixItHint::CreateReplacement(Range, Replacement)
-        << Inserter.createIncludeInsertion(
-               Result.SourceManager->getFileID(Location), "<limits>");
-  };
-
-  for (const auto &[Value, Replacement] : SignedConstants)
-    Fixer(MatchedIntegerConstant.getSExtValue(), Value, Replacement);
-
-  for (const auto &[Value, Replacement] : UnsignedConstants)
-    Fixer(MatchedIntegerConstant.getZExtValue(), Value, Replacement);
-}
-
-} // namespace clang::tidy::readability
diff --git a/clang-tools-extra/clang-tidy/readability/UseNumericLimitsCheck.h b/clang-tools-extra/clang-tidy/readability/UseNumericLimitsCheck.h
deleted file mode 100644
index 0e7e9abb8562c..0000000000000
--- a/clang-tools-extra/clang-tidy/readability/UseNumericLimitsCheck.h
+++ /dev/null
@@ -1,38 +0,0 @@
-//===--- UseNumericLimitsCheck.h - clang-tidy -------------------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_USENUMERICLIMITSCHECK_H
-#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_USENUMERICLIMITSCHECK_H
-
-#include "../ClangTidyCheck.h"
-#include "../utils/IncludeInserter.h"
-
-namespace clang::tidy::readability {
-
-/// Finds certain integer literals and suggests replacing them with equivalent
-/// ``std::numeric_limits`` calls.
-/// For the user-facing documentation see:
-/// http://clang.llvm.org/extra/clang-tidy/checks/readability/use-numeric-limits.html
-class UseNumericLimitsCheck : public ClangTidyCheck {
-public:
-  UseNumericLimitsCheck(StringRef Name, ClangTidyContext *Context);
-  void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
-  void registerMatchers(ast_matchers::MatchFinder *Finder) override;
-  void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
-                           Preprocessor *ModuleExpanderPP) override;
-  void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
-
-private:
-  const llvm::SmallVector<std::pair<int64_t, std::string>> SignedConstants;
-  const llvm::SmallVector<std::pair<uint64_t, std::string>> UnsignedConstants;
-  utils::IncludeInserter Inserter;
-};
-
-} // namespace clang::tidy::readability
-
-#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_USENUMERICLIMITSCHECK_H
diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst
index a802b5fc6699f..bcd843fc5179d 100644
--- a/clang-tools-extra/docs/ReleaseNotes.rst
+++ b/clang-tools-extra/docs/ReleaseNotes.rst
@@ -154,12 +154,6 @@ New checks
   Finds potentially erroneous calls to ``reset`` method on smart pointers when
   the pointee type also has a ``reset`` method.
 
-- New :doc:`readability-use-numeric-limits
-  <clang-tidy/checks/readability/use-numeric-limits>` check.
-
-  Finds certain integer literals and suggests replacing them with equivalent
-  ``std::numeric_limits`` calls.
-
 New check aliases
 ^^^^^^^^^^^^^^^^^
 
diff --git a/clang-tools-extra/docs/clang-tidy/checks/list.rst b/clang-tools-extra/docs/clang-tidy/checks/list.rst
index 57ae7d330a3ce..ccb78ee45e9c4 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/list.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/list.rst
@@ -409,7 +409,6 @@ Clang-Tidy Checks
    :doc:`readability-uniqueptr-delete-release <readability/uniqueptr-delete-release>`, "Yes"
    :doc:`readability-uppercase-literal-suffix <readability/uppercase-literal-suffix>`, "Yes"
    :doc:`readability-use-anyofallof <readability/use-anyofallof>`,
-   :doc:`readability-use-numeric-limits <readability/use-numeric-limits>`, "Yes"
    :doc:`readability-use-std-min-max <readability/use-std-min-max>`, "Yes"
    :doc:`zircon-temporary-objects <zircon/temporary-objects>`,
 
diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability/use-numeric-limits.rst b/clang-tools-extra/docs/clang-tidy/checks/readability/use-numeric-limits.rst
deleted file mode 100644
index 0f6ca9f0cf2c0..0000000000000
--- a/clang-tools-extra/docs/clang-tidy/checks/readability/use-numeric-limits.rst
+++ /dev/null
@@ -1,31 +0,0 @@
-.. title:: clang-tidy - readability-use-numeric-limits
-
-readability-use-numeric-limits
-==============================
-
-Finds certain integer literals and suggests replacing them with equivalent
-``std::numeric_limits`` calls.
-
-Before:
-
-.. code-block:: c++
-
-  void foo() {
-    int32_t a = 2147483647;
-  }
-
-After:
-
-.. code-block:: c++
-
-  void foo() {
-    int32_t a = std::numeric_limits<int32_t>::max();
-  }
-
-Options
--------
-
-.. option:: IncludeStyle
-
-   A string specifying which include-style is used, `llvm` or `google`. Default
-   is `llvm`.
diff --git a/clang-tools-extra/test/clang-tidy/checkers/readability/use-numeric-limits.cpp b/clang-tools-extra/test/clang-tidy/checkers/readability/use-numeric-limits.cpp
deleted file mode 100644
index e02d6f1b7126d..0000000000000
--- a/clang-tools-extra/test/clang-tidy/checkers/readability/use-numeric-limits.cpp
+++ /dev/null
@@ -1,100 +0,0 @@
-// RUN: %check_clang_tidy %s readability-use-numeric-limits %t
-// CHECK-FIXES: #include <limits>
-
-using int8_t = signed char;
-using int16_t = short;
-using int32_t = int;
-using int64_t = long long;
-using uint8_t = unsigned char;
-using uint16_t = unsigned short;
-using uint32_t = unsigned int;
-using uint64_t = unsigned long long;
-
-
-void Invalid() {
-  // CHECK-MESSAGES: :[[@LINE+2]]:14: warning: the constant '-128' is being utilized; consider using 'std::numeric_limits<int8_t>::min()' instead [readability-use-numeric-limits]
-  // CHECK-FIXES: int8_t a = std::numeric_limits<int8_t>::min();
-  int8_t a = -128;
-
-  // CHECK-MESSAGES: :[[@LINE+2]]:14: warning: the constant '127' is being utilized; consider using 'std::numeric_limits<int8_t>::max()' instead [readability-use-numeric-limits]
-  // CHECK-FIXES: int8_t b = std::numeric_limits<int8_t>::max();
-  int8_t b = +127;
-
-  // CHECK-MESSAGES: :[[@LINE+2]]:14: warning: the constant '127' is being utilized; consider using 'std::numeric_limits<int8_t>::max()' instead [readability-use-numeric-limits]
-  // CHECK-FIXES: int8_t c = std::numeric_limits<int8_t>::max();
-  int8_t c = 127;
-
-  // CHECK-MESSAGES: :[[@LINE+2]]:15: warning: the constant '-32768' is being utilized; consider using 'std::numeric_limits<int16_t>::min()' instead [readability-use-numeric-limits]
-  // CHECK-FIXES: int16_t d = std::numeric_limits<int16_t>::min();
-  int16_t d = -32768;
-
-  // CHECK-MESSAGES: :[[@LINE+2]]:15: warning: the constant '32767' is being utilized; consider using 'std::numeric_limits<int16_t>::max()' instead [readability-use-numeric-limits]
-  // CHECK-FIXES: int16_t e = std::numeric_limits<int16_t>::max();
-  int16_t e = +32767;
-
-  // CHECK-MESSAGES: :[[@LINE+2]]:15: warning: the constant '32767' is being utilized; consider using 'std::numeric_limits<int16_t>::max()' instead [readability-use-numeric-limits]
-  // CHECK-FIXES: int16_t f = std::numeric_limits<int16_t>::max();
-  int16_t f = 32767;
-
-  // CHECK-MESSAGES: :[[@LINE+2]]:15: warning: the constant '-2147483648' is being utilized; consider using 'std::numeric_limits<int32_t>::min()' instead [readability-use-numeric-limits]
-  // CHECK-FIXES: int32_t g = std::numeric_limits<int32_t>::min();
-  int32_t g = -2147483648;
-
-  // CHECK-MESSAGES: :[[@LINE+2]]:15: warning: the constant '2147483647' is being utilized; consider using 'std::numeric_limits<int32_t>::max()' instead [readability-use-numeric-limits]
-  // CHECK-FIXES: int32_t h = std::numeric_limits<int32_t>::max();
-  int32_t h = +2147483647;
-
-  // CHECK-MESSAGES: :[[@LINE+2]]:15: warning: the constant '2147483647' is being utilized; consider using 'std::numeric_limits<int32_t>::max()' instead [readability-use-numeric-limits]
-  // CHECK-FIXES: int32_t i = std::numeric_limits<int32_t>::max();
-  int32_t i = 2147483647;
-
-  // CHECK-MESSAGES: :[[@LINE+2]]:15: warning: the constant '-9223372036854775808' is being utilized; consider using 'std::numeric_limits<int64_t>::min()' instead [readability-use-numeric-limits]
-  // CHECK-FIXES: int64_t j = std::numeric_limits<int64_t>::min();
-  int64_t j = -9223372036854775808;
-
-  // CHECK-MESSAGES: :[[@LINE+2]]:15: warning: the constant '9223372036854775807' is being utilized; consider using 'std::numeric_limits<int64_t>::max()' instead [readability-use-numeric-limits]
-  // CHECK-FIXES: int64_t k = std::numeric_limits<int64_t>::max();
-  int64_t k = +9223372036854775807;
-
-  // CHECK-MESSAGES: :[[@LINE+2]]:15: warning: the constant '9223372036854775807' is being utilized; consider using 'std::numeric_limits<int64_t>::max()' instead [readability-use-numeric-limits]
-  // CHECK-FIXES: int64_t l = std::numeric_limits<int64_t>::max();
-  int64_t l = 9223372036854775807;
-
-  // CHECK-MESSAGES: :[[@LINE+2]]:15: warning: the constant '255' is being utilized; consider using 'std::numeric_limits<uint8_t>::max()' instead [readability-use-numeric-limits]
-  // CHECK-FIXES: uint8_t m = std::numeric_limits<uint8_t>::max();
-  uint8_t m = 255;
-
-  // CHECK-MESSAGES: :[[@LINE+2]]:15: warning: the constant '255' is being utilized; consider using 'std::numeric_limits<uint8_t>::max()' instead [readability-use-numeric-limits]
-  // CHECK-FIXES: uint8_t n = std::numeric_limits<uint8_t>::max();
-  uint8_t n = +255;
-
-  // CHECK-MESSAGES: :[[@LINE+2]]:16: warning: the constant '65535' is being utilized; consider using 'std::numeric_limits<uint16_t>::max()' instead [readability-use-numeric-limits]
-  // CHECK-FIXES: uint16_t o = std::numeric_limits<uint16_t>::max();
-  uint16_t o = 65535;
-
-  // CHECK-MESSAGES: :[[@LINE+2]]:16: warning: the constant '65535' is being utilized; consider using 'std::numeric_limits<uint16_t>::max()' instead [readability-use-numeric-limits]
-  // CHECK-FIXES: uint16_t p = std::numeric_limits<uint16_t>::max();
-  uint16_t p = +65535;
-
-  // CHECK-MESSAGES: :[[@LINE+2]]:16: warning: the constant '4294967295' is being utilized; consider using 'std::numeric_limits<uint32_t>::max()' instead [readability-use-numeric-limits]
-  // CHECK-FIXES: uint32_t q = std::numeric_limits<uint32_t>::max();
-  uint32_t q = 4294967295;
-
-  // CHECK-MESSAGES: :[[@LINE+2]]:16: warning: the constant '4294967295' is being utilized; consider using 'std::numeric_limits<uint32_t>::max()' instead [readability-use-numeric-limits]
-  // CHECK-FIXES: uint32_t r = std::numeric_limits<uint32_t>::max();
-  uint32_t r = +4294967295;
-
-  // CHECK-MESSAGES: :[[@LINE+2]]:16: warning: the constant '18446744073709551615' is being utilized; consider using 'std::numeric_limits<uint64_t>::max()' instead [readability-use-numeric-limits]
-  // CHECK-FIXES: uint64_t s = std::numeric_limits<uint64_t>::max();
-  uint64_t s = 18446744073709551615;
-
-  // CHECK-MESSAGES: :[[@LINE+2]]:16: warning: the constant '18446744073709551615' is being utilized; consider using 'std::numeric_limits<uint64_t>::max()' instead [readability-use-numeric-limits]
-  // CHECK-FIXES: uint64_t t = std::numeric_limits<uint64_t>::max();
-  uint64_t t = +18446744073709551615;
-}
-
-void Valid(){
-  int16_t a = +128;
-
-  int16_t b = -127;
-}

@vbvictor vbvictor merged commit c594f6e into main Jun 23, 2025
11 checks passed
@vbvictor vbvictor deleted the revert-127430-clang-tidy-readability-use-numeric-limits branch June 23, 2025 16:39
miguelcsx pushed a commit to miguelcsx/llvm-project that referenced this pull request Jun 23, 2025
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 23, 2025

LLVM Buildbot has detected a new failure on builder clang-m68k-linux-cross running on suse-gary-m68k-cross while building clang-tools-extra at step 5 "ninja check 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/27/builds/11978

Here is the relevant piece of the build log for the reference
Step 5 (ninja check 1) failure: stage 1 checked (failure)
...
[324/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTests/ParenExpr.cpp.o
[325/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTests/TemplateArgumentLocTraverser.cpp.o
[326/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTests/TraversalScope.cpp.o
[327/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTestDeclVisitor.cpp.o
[328/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTestTypeLocVisitor.cpp.o
[329/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/ReplacementsYamlTest.cpp.o
[330/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Frontend/FixedPointString.cpp.o
[331/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RefactoringActionRulesTest.cpp.o
[332/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Frontend/ParsedSourceLocationTest.cpp.o
[333/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ASTImporterTest.cpp.o
FAILED: tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ASTImporterTest.cpp.o 
/usr/bin/c++ -DGTEST_HAS_RTTI=0 -DLLVM_BUILD_STATIC -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/tools/clang/unittests -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/tools/clang/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/llvm/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests/Tooling -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/third-party/unittest/googletest/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/third-party/unittest/googlemock/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -O3 -DNDEBUG -std=c++17  -Wno-variadic-macros -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -Wno-suggest-override -MD -MT tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ASTImporterTest.cpp.o -MF tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ASTImporterTest.cpp.o.d -o tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ASTImporterTest.cpp.o -c /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests/AST/ASTImporterTest.cpp
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
[334/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/Syntax/TreeTestBase.cpp.o
[335/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/Syntax/MutationsTest.cpp.o
[336/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTests/InitListExprPostOrder.cpp.o
[337/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/Syntax/SynthesisTest.cpp.o
[338/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTests/InitListExprPostOrderNoQueue.cpp.o
[339/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/Syntax/TreeTest.cpp.o
[340/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/ToolingTest.cpp.o
[341/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RefactoringCallbacksTest.cpp.o
[342/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Frontend/ReparseWorkingDirTest.cpp.o
[343/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RefactoringTest.cpp.o
[344/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Frontend/CompilerInstanceTest.cpp.o
[345/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/SourceCodeBuildersTest.cpp.o
[346/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Frontend/CodeGenActionTest.cpp.o
[347/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Frontend/ASTUnitTest.cpp.o
[348/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Frontend/FrontendActionTest.cpp.o
In file included from /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests/Frontend/FrontendActionTest.cpp:19:
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include/clang/Sema/Sema.h:839:7: warning: ‘clang::Sema’ declared with greater visibility than the type of its field ‘clang::Sema::UnusedFileScopedDecls’ [-Wattributes]
  839 | class Sema final : public SemaBase {
      |       ^~~~
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include/clang/Sema/Sema.h:839:7: warning: ‘clang::Sema’ declared with greater visibility than the type of its field ‘clang::Sema::TentativeDefinitions’ [-Wattributes]
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include/clang/Sema/Sema.h:839:7: warning: ‘clang::Sema’ declared with greater visibility than the type of its field ‘clang::Sema::ExtVectorDecls’ [-Wattributes]
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include/clang/Sema/Sema.h:839:7: warning: ‘clang::Sema’ declared with greater visibility than the type of its field ‘clang::Sema::DelegatingCtorDecls’ [-Wattributes]
[349/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/Syntax/TokensTest.cpp.o
[350/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Frontend/OutputStreamTest.cpp.o
[351/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTests/CallbacksLeaf.cpp.o
[352/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Frontend/SearchPathTest.cpp.o
[353/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/SourceCodeTest.cpp.o
[354/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Frontend/PCHPreambleTest.cpp.o
[355/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/Syntax/BuildTreeTest.cpp.o
[356/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTests/CallbacksUnaryOperator.cpp.o
[357/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTestPostOrderVisitor.cpp.o
[358/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/StencilTest.cpp.o
[359/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Frontend/CompilerInvocationTest.cpp.o
[360/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/ASTMatchers/ASTMatchersNarrowingTest.cpp.o
[361/1159] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTests/CallbacksCallExpr.cpp.o

Jaddyen pushed a commit to Jaddyen/llvm-project that referenced this pull request Jun 23, 2025
anthonyhatran pushed a commit to anthonyhatran/llvm-project that referenced this pull request Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants