Skip to content

Commit 473e251

Browse files
authored
[clang] Document the return value of __builtin_COLUMN (llvm#118360)
PR for issue llvm#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.
1 parent 05860f9 commit 473e251

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

clang/docs/LanguageExtensions.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4526,9 +4526,13 @@ default member initializer, the invocation point is the location of the
45264526
constructor or aggregate initialization used to create the object. Otherwise
45274527
the invocation point is the same as the location of the builtin.
45284528
4529-
When the invocation point of ``__builtin_FUNCTION`` is not a function scope the
4529+
When the invocation point of ``__builtin_FUNCTION`` is not a function scope, the
45304530
empty string is returned.
45314531
4532+
The builtin ``__builtin_COLUMN`` returns the offset from the start of the line,
4533+
beginning from column 1. `This may differ from other implementations.
4534+
<https://eel.is/c++draft/support.srcloc#tab:support.srcloc.current-row-3-column-2-sentence-2>`_
4535+
45324536
The builtin ``__builtin_source_location`` returns a pointer to constant static
45334537
data of type ``std::source_location::__impl``. This type must have already been
45344538
defined, and must contain exactly four fields: ``const char *_M_file_name``,

0 commit comments

Comments
 (0)