[clang] 9367bd0 - Improve example documentation for __builtin_offsetof; NFC

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 30 11:55:49 PST 2023


Author: Aaron Ballman
Date: 2023-01-30T14:54:59-05:00
New Revision: 9367bd05913b11aaadf89c4edeced4321c65b605

URL: https://github.com/llvm/llvm-project/commit/9367bd05913b11aaadf89c4edeced4321c65b605
DIFF: https://github.com/llvm/llvm-project/commit/9367bd05913b11aaadf89c4edeced4321c65b605.diff

LOG: Improve example documentation for __builtin_offsetof; NFC

This implements some post-commit feedback from D142723

Added: 
    

Modified: 
    clang/docs/LanguageExtensions.rst

Removed: 
    


################################################################################
diff  --git a/clang/docs/LanguageExtensions.rst b/clang/docs/LanguageExtensions.rst
index 75fcd418e7ea2..0b533a2ff7596 100644
--- a/clang/docs/LanguageExtensions.rst
+++ b/clang/docs/LanguageExtensions.rst
@@ -2386,7 +2386,7 @@ calculates the offset (in bytes) to a given member of the given type.
 
   const int offset_to_i = __builtin_offsetof(struct S, i);
   const int ext1 = __builtin_offsetof(struct U { int i; }, i); // C extension
-  const int ext2 = __builtin_offsetof(struct S, t.f[1]);
+  const int offset_to_subobject = __builtin_offsetof(struct S, t.f[1]);
 
 **Description**:
 


        


More information about the cfe-commits mailing list