[libc-commits] [libc] 9557fcc - [libc] Fix lint message (#73956)

via libc-commits libc-commits at lists.llvm.org
Fri Dec 1 00:32:30 PST 2023


Author: Guillaume Chatelet
Date: 2023-12-01T09:32:22+01:00
New Revision: 9557fcca563dba3dd31769c297bb3b97d6e614f9

URL: https://github.com/llvm/llvm-project/commit/9557fcca563dba3dd31769c297bb3b97d6e614f9
DIFF: https://github.com/llvm/llvm-project/commit/9557fcca563dba3dd31769c297bb3b97d6e614f9.diff

LOG: [libc] Fix lint message (#73956)

Added: 
    

Modified: 
    libc/src/__support/CMakeLists.txt
    libc/src/__support/str_to_num_result.h
    utils/bazel/llvm-project-overlay/libc/BUILD.bazel

Removed: 
    


################################################################################
diff  --git a/libc/src/__support/CMakeLists.txt b/libc/src/__support/CMakeLists.txt
index a76b22960f5a504..decd6ed2dbd2bd7 100644
--- a/libc/src/__support/CMakeLists.txt
+++ b/libc/src/__support/CMakeLists.txt
@@ -79,6 +79,8 @@ add_header_library(
   str_to_num_result
   HDRS
     str_to_num_result.h
+  DEPENDS
+    libc.src.__support.macros.attributes
 )
 
 add_header_library(

diff  --git a/libc/src/__support/str_to_num_result.h b/libc/src/__support/str_to_num_result.h
index 9ba704c690655ee..b32fbdeeb580fee 100644
--- a/libc/src/__support/str_to_num_result.h
+++ b/libc/src/__support/str_to_num_result.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_LIBC_SRC___SUPPORT_STR_TO_NUM_RESULT_H
 #define LLVM_LIBC_SRC___SUPPORT_STR_TO_NUM_RESULT_H
 
+#include "src/__support/macros/attributes.h" // LIBC_INLINE
+
 #include <stddef.h>
 
 namespace LIBC_NAMESPACE {
@@ -18,15 +20,16 @@ template <typename T> struct StrToNumResult {
   int error;
   ptr
diff _t parsed_len;
 
-  constexpr StrToNumResult(T value) : value(value), error(0), parsed_len(0) {}
-  constexpr StrToNumResult(T value, ptr
diff _t parsed_len)
+  LIBC_INLINE constexpr StrToNumResult(T value)
+      : value(value), error(0), parsed_len(0) {}
+  LIBC_INLINE constexpr StrToNumResult(T value, ptr
diff _t parsed_len)
       : value(value), error(0), parsed_len(parsed_len) {}
-  constexpr StrToNumResult(T value, ptr
diff _t parsed_len, int error)
+  LIBC_INLINE constexpr StrToNumResult(T value, ptr
diff _t parsed_len, int error)
       : value(value), error(error), parsed_len(parsed_len) {}
 
-  constexpr bool has_error() { return error != 0; }
+  LIBC_INLINE constexpr bool has_error() { return error != 0; }
 
-  constexpr operator T() { return value; }
+  LIBC_INLINE constexpr operator T() { return value; }
 };
 } // namespace LIBC_NAMESPACE
 

diff  --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index a0a6a4366ea7537..fdd620a4d415c09 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -474,8 +474,7 @@ libc_support_library(
 libc_support_library(
     name = "__support_str_to_num_result",
     hdrs = ["src/__support/str_to_num_result.h"],
-    deps = [
-    ],
+    deps = [":__support_macros_attributes"],
 )
 
 libc_support_library(


        


More information about the libc-commits mailing list