[clang-tools-extra] 93f9f63 - [clang-tidy][NFC] Update documentation for fuchsia-statically-constructed-objects

Piotr Zegar via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 6 11:07:06 PDT 2023


Author: Piotr Zegar
Date: 2023-09-06T18:06:59Z
New Revision: 93f9f63b2d3e04ec4abd79fb8119a685d9f750c6

URL: https://github.com/llvm/llvm-project/commit/93f9f63b2d3e04ec4abd79fb8119a685d9f750c6
DIFF: https://github.com/llvm/llvm-project/commit/93f9f63b2d3e04ec4abd79fb8119a685d9f750c6.diff

LOG: [clang-tidy][NFC] Update documentation for fuchsia-statically-constructed-objects

Fix compile errors in example provided in
documentation.

Fixes: #65118

Added: 
    

Modified: 
    clang-tools-extra/docs/clang-tidy/checks/fuchsia/statically-constructed-objects.rst

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/docs/clang-tidy/checks/fuchsia/statically-constructed-objects.rst b/clang-tools-extra/docs/clang-tidy/checks/fuchsia/statically-constructed-objects.rst
index 4696269e3765532..bed9e5ac0cfd087 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/fuchsia/statically-constructed-objects.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/fuchsia/statically-constructed-objects.rst
@@ -22,8 +22,8 @@ For example:
 
   class C {
   public:
-    C(int Val) : Val(Val) {}
-    constexpr C() : Val(0) {}
+    constexpr C(int Val) : Val(Val) {}
+    C(int Val1, int Val2) : Val(Val1+Val2) {}
 
   private:
     int Val;
@@ -38,6 +38,6 @@ For example:
   static int i;       // No warning, as it is trivial
 
   extern int get_i();
-  static C(get_i())   // Warning, as the constructor is dynamically initialized
+  static C c3(get_i());// Warning, as the constructor is dynamically initialized
 
 See the features disallowed in Fuchsia at https://fuchsia.dev/fuchsia-src/development/languages/c-cpp/cxx?hl=en


        


More information about the cfe-commits mailing list