[clang] 473e251 - [clang] Document the return value of __builtin_COLUMN (#118360)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 13 01:50:17 PST 2024
Author: GeorgeKA
Date: 2024-12-13T10:50:12+01:00
New Revision: 473e2518e850598feae62916ebef4b4dbc88a0ee
URL: https://github.com/llvm/llvm-project/commit/473e2518e850598feae62916ebef4b4dbc88a0ee
DIFF: https://github.com/llvm/llvm-project/commit/473e2518e850598feae62916ebef4b4dbc88a0ee.diff
LOG: [clang] Document the return value of __builtin_COLUMN (#118360)
PR for issue #78657
Updated clang/docs/LanguageExtensions.rst to detail the return value of
__builtin_COLUMN for this implementation.
--
Fyi, this is my first contribution, so please bear with me.
There already appears to be a unit test for __builtin_COLUMN in
clang/test/SemaCXX/source_location.cpp.
Added:
Modified:
clang/docs/LanguageExtensions.rst
Removed:
################################################################################
diff --git a/clang/docs/LanguageExtensions.rst b/clang/docs/LanguageExtensions.rst
index 54b6f947a6a5a5..3d4f68b818bce7 100644
--- a/clang/docs/LanguageExtensions.rst
+++ b/clang/docs/LanguageExtensions.rst
@@ -4526,9 +4526,13 @@ default member initializer, the invocation point is the location of the
constructor or aggregate initialization used to create the object. Otherwise
the invocation point is the same as the location of the builtin.
-When the invocation point of ``__builtin_FUNCTION`` is not a function scope the
+When the invocation point of ``__builtin_FUNCTION`` is not a function scope, the
empty string is returned.
+The builtin ``__builtin_COLUMN`` returns the offset from the start of the line,
+beginning from column 1. `This may
diff er from other implementations.
+<https://eel.is/c++draft/support.srcloc#tab:support.srcloc.current-row-3-column-2-sentence-2>`_
+
The builtin ``__builtin_source_location`` returns a pointer to constant static
data of type ``std::source_location::__impl``. This type must have already been
defined, and must contain exactly four fields: ``const char *_M_file_name``,
More information about the cfe-commits
mailing list