[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2025-01-20 Thread Nikolas Klauser via cfe-commits

https://github.com/philnik777 closed 
https://github.com/llvm/llvm-project/pull/84591
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2025-01-15 Thread Nikolas Klauser via cfe-commits

https://github.com/philnik777 updated 
https://github.com/llvm/llvm-project/pull/84591

>From 46f59109c0f4902e798195128855345347ac128c Mon Sep 17 00:00:00 2001
From: Nikolas Klauser 
Date: Sat, 9 Mar 2024 02:14:36 +0100
Subject: [PATCH] [Clang] Document some of the implementation-defined keywords

---
 clang/docs/LanguageExtensions.rst | 119 +++---
 1 file changed, 108 insertions(+), 11 deletions(-)

diff --git a/clang/docs/LanguageExtensions.rst 
b/clang/docs/LanguageExtensions.rst
index 2eb0777dbdc6c8..b15dd3e036e84a 100644
--- a/clang/docs/LanguageExtensions.rst
+++ b/clang/docs/LanguageExtensions.rst
@@ -434,6 +434,114 @@ __datasizeof
 ``__datasizeof`` behaves like ``sizeof``, except that it returns the size of 
the
 type ignoring tail padding.
 
+_BitInt, _ExtInt
+
+
+Clang supports the C23 ``_BitInt(N)`` feature as an extension in older C modes
+and in C++. This type was previously implemented in Clang with the same
+semantics, but spelled ``_ExtInt(N)``. This spelling has been deprecated in
+favor of the standard type.
+
+Note: the ABI for ``_BitInt(N)`` is still in the process of being stabilized,
+so this type should not yet be used in interfaces that require ABI stability.
+
+C keywords supported in all language modes
+--
+
+Clang supports ``_Alignas``, ``_Alignof``, ``_Atomic``, ``_Complex``,
+``_Generic``, ``_Imaginary``, ``_Noreturn``, ``_Static_assert``,
+``_Thread_local``, and ``_Float16`` in all language modes with the C semantics.
+
+__alignof, __alignof__
+--
+
+``__alignof`` and ``__alignof__`` return, in contrast to ``_Alignof`` and
+``alignof``, the preferred alignment of a type. This may be larger than the
+required alignment for improved performance.
+
+__extension__
+-
+
+``__extension__`` suppresses extension diagnostics in the statement it is
+prepended to.
+
+__auto_type
+---
+
+``__auto_type`` behaves the same as ``auto`` in C++11 but is available in all
+language modes.
+
+__imag, __imag__
+
+
+``__imag`` and ``__imag__`` can be used to get the imaginary part of a complex
+value.
+
+__real, __real__
+
+
+``__real`` and ``__real__`` can be used to get the real part of a complex 
value.
+
+__asm, __asm__
+--
+
+``__asm`` and ``__asm__`` are alternate spellings for ``asm``, but available in
+all language modes.
+
+__complex, __complex__
+--
+
+``__complex`` and ``__complex__`` are alternate spellings for ``_Complex``.
+
+__const, __const__, __volatile, __volatile__, __restrict, __restrict__
+--
+
+These are alternate spellings for their non-underscore counterparts, but are
+available in all langauge modes.
+
+__decltype
+--
+
+``__decltype`` is an alternate spelling for ``decltype``, but is also available
+in C++ modes before C++11.
+
+__inline, __inline__
+
+
+``__inline`` and ``__inline__`` are alternate spellings for ``inline``, but are
+available in all language modes.
+
+__nullptr
+-
+
+``__nullptr`` is an alternate spelling for ``nullptr``, but is also available 
in
+C++ modes prior to C++11. Note that it's currently not availbale in C despite
+C23 having support for ``nullptr``.
+
+__signed, __signed__
+
+
+``__signed`` and ``__signed__`` are alternate spellings for ``signed``.
+``__unsigned`` and ``__unsigned__`` are **not** supported.
+
+__typeof, __typeof__, __typeof_unqual, __typeof_unqual__
+
+
+``__typeof`` and ``__typeof__`` are alternate spellings for ``typeof``, but are
+available in all langauge modes. These spellings result in the operand,
+retaining all qualifiers.
+
+``__typeof_unqual`` and ``__typeof_unqual__`` are alternate spellings for the
+C23 ``typeof_unqual`` type specifier, but are available in all language modes.
+These spellings result in the type of the operand, stripping all qualifiers.
+
+__char16_t, __char32_t
+--
+
+``__char16_t`` and ``__char32_t`` are alternate spellings for ``char16_t`` and
+``char32_t`` respectively, but are also available in C++ modes before C++11.
+They are only supported in C++. ``__char8_t`` is not available.
+
 ..
   FIXME: This should list all the keyword extensions
 
@@ -5785,17 +5893,6 @@ Examples are:
# 60 "" 2 // return to "main.c"
# 1 "/usr/ancient/header.h" 1 4 // Enter an implicit extern "C" header
 
-Extended Integer Types
-==
-
-Clang supports the C23 ``_BitInt(N)`` feature as an extension in older C modes
-and in C++. This type was previously implemented in Clang with the same
-semantics, but spelled ``_ExtInt(N)``. This spelling has been deprecated in
-favor of the standard type.
-
-Note: the ABI for ``_BitInt(N)`` is still in the process of being stabilized,
-so this type should not yet be used in inter

[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2025-01-02 Thread Nikolas Klauser via cfe-commits

https://github.com/philnik777 updated 
https://github.com/llvm/llvm-project/pull/84591

>From 56167d0e07c0d676aaae796f18af6f7f1f1c1076 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser 
Date: Sat, 9 Mar 2024 02:14:36 +0100
Subject: [PATCH] [Clang] Document some of the implementation-defined keywords

---
 clang/docs/LanguageExtensions.rst | 114 +++---
 1 file changed, 103 insertions(+), 11 deletions(-)

diff --git a/clang/docs/LanguageExtensions.rst 
b/clang/docs/LanguageExtensions.rst
index 06af93fd3c15ca..589f205340f6b8 100644
--- a/clang/docs/LanguageExtensions.rst
+++ b/clang/docs/LanguageExtensions.rst
@@ -433,6 +433,109 @@ __datasizeof
 ``__datasizeof`` behaves like ``sizeof``, except that it returns the size of 
the
 type ignoring tail padding.
 
+_BitInt, _ExtInt
+
+
+Clang supports the C23 ``_BitInt(N)`` feature as an extension in older C modes
+and in C++. This type was previously implemented in Clang with the same
+semantics, but spelled ``_ExtInt(N)``. This spelling has been deprecated in
+favor of the standard type.
+
+Note: the ABI for ``_BitInt(N)`` is still in the process of being stabilized,
+so this type should not yet be used in interfaces that require ABI stability.
+
+C keywords supported in all language modes
+--
+
+Clang supports ``_Alignas``, ``_Alignof``, ``_Atomic``, ``_Complex``,
+``_Generic``, ``_Imaginary``, ``_Noreturn``, ``_Static_assert``,
+``_Thread_local``, and ``_Float16`` in all language modes with the C semantics.
+
+__alignof, __alignof__
+--
+
+``__alignof`` and ``__alignof__`` return, in contrast to ``_Alignof`` and
+``alignof``, the preferred alignment of a type. This may be larger than the
+required alignment for improved performance.
+
+__extension__
+-
+
+``__extension__`` suppresses extension diagnostics in the statement it is
+prepended to.
+
+__auto_type
+---
+
+``__auto_type`` behaves the same as ``auto`` in C++11 but is available in all
+language modes.
+
+__imag, __imag__
+
+
+``__imag`` and ``__imag__`` can be used to get the imaginary part of a complex
+value.
+
+__real, __real__
+
+
+``__real`` and ``__real__`` can be used to get the real part of a complex 
value.
+
+__asm, __asm__
+--
+
+``__asm`` and ``__asm__`` are alternate spellings for ``asm``, but available in
+all language modes.
+
+__complex, __complex__
+--
+
+``__complex`` and ``__complex__`` are alternate spellings for ``_Complex``.
+
+__const, __const__, __volatile, __volatile__, __restrict, __restrict__
+--
+
+These are alternate spellings for their non-underscore counterparts, but are
+available in all langauge modes.
+
+__decltype
+--
+
+``__decltype`` is an alternate spelling for ``decltype``, but is also available
+in C++ modes before C++11.
+
+__inline, __inline__
+
+
+``__inline`` and ``__inline__`` are alternate spellings for ``inline``, but are
+available in all language modes.
+
+__nullptr
+-
+
+``__nullptr`` is an alternate spelling for ``nullptr``, but is also available 
in
+C++ modes prior to C++11. Note that it's currently not availbale in C despite
+C23 having support for ``nullptr``.
+
+__signed, __signed__
+
+
+``__signed`` and ``__signed__`` are alternate spellings for ``signed``.
+``__unsigned`` and ``__unsigned__`` are **not** supported.
+
+__typeof, __typeof__
+
+
+``__typeof`` and ``__typeof__`` are alternate spellings for ``typeof``, but are
+available in all langauge modes.
+
+__char16_t, __char32_t
+--
+
+``__char16_t`` and ``__char32_t`` are alternate spellings for ``char16_t`` and
+``char32_t`` respectively, but are also available in C++ modes before C++11.
+They are only supported in C++. ``__char8_t`` is not available.
+
 ..
   FIXME: This should list all the keyword extensions
 
@@ -5319,17 +5422,6 @@ Examples are:
# 60 "" 2 // return to "main.c"
# 1 "/usr/ancient/header.h" 1 4 // Enter an implicit extern "C" header
 
-Extended Integer Types
-==
-
-Clang supports the C23 ``_BitInt(N)`` feature as an extension in older C modes
-and in C++. This type was previously implemented in Clang with the same
-semantics, but spelled ``_ExtInt(N)``. This spelling has been deprecated in
-favor of the standard type.
-
-Note: the ABI for ``_BitInt(N)`` is still in the process of being stabilized,
-so this type should not yet be used in interfaces that require ABI stability.
-
 Intrinsics Support within Constant Expressions
 ==
 

___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2025-01-02 Thread Nikolas Klauser via cfe-commits

https://github.com/philnik777 updated 
https://github.com/llvm/llvm-project/pull/84591

>From c95d92ebfafa55ef7ded7464457776131bdd59d2 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser 
Date: Sat, 9 Mar 2024 02:14:36 +0100
Subject: [PATCH] [Clang] Document some of the implementation-defined keywords

---
 clang/docs/LanguageExtensions.rst | 116 +++---
 1 file changed, 105 insertions(+), 11 deletions(-)

diff --git a/clang/docs/LanguageExtensions.rst 
b/clang/docs/LanguageExtensions.rst
index 06af93fd3c15ca..b11bb3adeec6d2 100644
--- a/clang/docs/LanguageExtensions.rst
+++ b/clang/docs/LanguageExtensions.rst
@@ -433,6 +433,111 @@ __datasizeof
 ``__datasizeof`` behaves like ``sizeof``, except that it returns the size of 
the
 type ignoring tail padding.
 
+_BitInt, _ExtInt
+
+
+Clang supports the C23 ``_BitInt(N)`` feature as an extension in older C modes
+and in C++. This type was previously implemented in Clang with the same
+semantics, but spelled ``_ExtInt(N)``. This spelling has been deprecated in
+favor of the standard type.
+
+Note: the ABI for ``_BitInt(N)`` is still in the process of being stabilized,
+so this type should not yet be used in interfaces that require ABI stability.
+
+C keywords supported in all language modes
+--
+
+Clang supports ``_Alignas``, ``_Alignof``, ``_Atomic``, ``_Complex``,
+``_Generic``, ``_Imaginary``, ``_Noreturn``, ``_Static_assert``,
+``_Thread_local``, and ``_Float16`` in all language modes with the C semantics.
+
+__alignof, __alignof__
+--
+
+``__alignof`` and ``__alignof__`` return, in contrast to ``_Alignof`` and
+``alignof``, the preferred alignment of a type. This may be larger than the
+required alignment for improved performance.
+
+__extension__
+-
+
+``__extension__`` suppresses extension diagnostics in the statement it is
+prepended to.
+
+__auto_type
+---
+
+``__auto_type`` behaves the same as ``auto`` in C++11 but is available in all
+language modes.
+
+__imag, __imag__
+
+
+``__imag`` and ``__imag__`` can be used to get the imaginary part of a complex
+value.
+
+__real, __real__
+
+
+``__real`` and ``__real__`` can be used to get the real part of a complex 
value.
+
+__asm, __asm__
+--
+
+``__asm`` and ``__asm__`` are alternate spellings for ``asm``, but available in
+all language modes.
+
+__complex, __complex__
+--
+
+``__complex`` and ``__complex__`` are alternate spellings for ``_Complex``.
+
+__const, __const__, __volatile, __volatile__, __restrict, __restrict__
+--
+
+These are alternate spellings for their non-underscore counterparts, but are
+available in all langauge modes.
+
+__decltype
+--
+
+``__decltype`` is an alternate spelling for ``decltype``, but is also available
+in C++ modes before C++11.
+
+__inline, __inline__
+
+
+``__inline`` and ``__inline__`` are alternate spellings for ``inline``, but are
+available in all language modes.
+
+__nullptr
+-
+
+``__nullptr`` is an alternate spelling for ``nullptr``, but is also available 
in
+C++ modes prior to C++11. Note that it's currently not availbale in C despite
+C23 having support for ``nullptr``.
+
+__signed, __signed__
+
+
+``__signed`` and ``__signed__`` are alternate spellings for ``signed``.
+``__unsigned`` and ``__unsigned__`` are **not** supported.
+
+__typeof, __typeof__
+
+
+``__typeof`` and ``__typeof__`` are alternate spellings for ``typeof``, but are
+available in all langauge modes.
+
+``__volatile`` and ``__volatile__`` are alternate spellings for ``volatile``.
+
+__char16_t, __char32_t
+--
+
+``__char16_t`` and ``__char32_t`` are alternate spellings for ``char16_t`` and
+``char32_t`` respectively, but are also available in C++ modes before C++11.
+They are only supported in C++. ``__char8_t`` is not available.
+
 ..
   FIXME: This should list all the keyword extensions
 
@@ -5319,17 +5424,6 @@ Examples are:
# 60 "" 2 // return to "main.c"
# 1 "/usr/ancient/header.h" 1 4 // Enter an implicit extern "C" header
 
-Extended Integer Types
-==
-
-Clang supports the C23 ``_BitInt(N)`` feature as an extension in older C modes
-and in C++. This type was previously implemented in Clang with the same
-semantics, but spelled ``_ExtInt(N)``. This spelling has been deprecated in
-favor of the standard type.
-
-Note: the ABI for ``_BitInt(N)`` is still in the process of being stabilized,
-so this type should not yet be used in interfaces that require ABI stability.
-
 Intrinsics Support within Constant Expressions
 ==
 

___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2025-01-02 Thread Nikolas Klauser via cfe-commits


@@ -433,6 +433,117 @@ __datasizeof
 ``__datasizeof`` behaves like ``sizeof``, except that it returns the size of 
the
 type ignoring tail padding.
 
+_BitInt, _ExtInt
+
+
+Clang supports the C23 ``_BitInt(N)`` feature as an extension in older C modes
+and in C++. This type was previously implemented in Clang with the same
+semantics, but spelled ``_ExtInt(N)``. This spelling has been deprecated in
+favor of the standard type.
+
+Note: the ABI for ``_BitInt(N)`` is still in the process of being stabilized,
+so this type should not yet be used in interfaces that require ABI stability.
+
+C keywords supported in all language modes
+--
+
+Clang supports ``_Alignas``, ``_Alignof``, ``_Atomic``, ``_Complex``,
+``_Generic``, ``_Imaginary``, ``_Noreturn``, ``_Static_assert``,
+``_Thread_local``, ``_Float16``, ``_Decimal32``, ``_Decimal64`` and
+``_Decimal128`` in all language modes with the C semantics.
+
+__alignof, __alignof__
+--
+
+``__alignof`` and ``__alignof__`` return, in contrast to ``_Alignof`` and
+``alignof``, the preferred alignment of a type. This may be larger than the
+required alignment for improved performance.
+
+__extension__
+-
+
+``__extension__`` suppressed extension diagnostics in the statement it is
+prepended to.
+
+__auto_type
+---
+
+``__auto_type`` behaves the same as C++11s ``auto`` but is available in all
+language modes.
+
+__imag, __imag__
+
+
+``__imag`` and ``__imag__`` can be used to get the imaginary part of a complex
+value.
+
+__real, __real__
+
+
+``__real`` and ``__real__`` can be used to get the real part of a complex 
value.
+
+__asm, __asm__
+--
+
+``__asm`` and ``__asm__`` are alternate spellings for ``asm``, but available in
+all language modes.
+
+__complex, __complex__
+--
+
+``__complex`` and ``__complex__`` are alternate spellings for ``_Complex``.
+
+__const, __const__
+--
+
+``__const`` and ``__const__`` are alternate spellings for ``const``.
+
+__decltype
+--
+
+``__decltype`` is an alternate spelling for ``decltype``, but is also available
+in C++ modes before C++11.
+
+__inline, __inline__
+
+
+``__inline`` and ``__inline__`` are alternate spellings for ``inline``, but are
+available in all language modes.
+
+__nullptr
+-
+
+``__nullptr`` is an alternate spelling for ``nullptr``, but is also available 
in
+C++ modes before C++11.
+
+__restrict, __restrict__
+
+
+``__restrict`` and ``__restrict__`` are alternate spellings for ``restrict``,
+but are available in all language modes.
+
+__signed, __signed__
+
+
+``__signed`` and ``__signed__`` are alternate spellings for ``signed``.
+
+__typeof, __typeof__
+
+
+``__typeof`` and ``__typeof__`` are alternate spellings for ``typeof``, but are

philnik777 wrote:

I don't really know much about `typeof`, so I'm not sure what you're asking 
here.

https://github.com/llvm/llvm-project/pull/84591
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2025-01-02 Thread Nikolas Klauser via cfe-commits


@@ -433,6 +433,117 @@ __datasizeof
 ``__datasizeof`` behaves like ``sizeof``, except that it returns the size of 
the
 type ignoring tail padding.
 
+_BitInt, _ExtInt
+
+
+Clang supports the C23 ``_BitInt(N)`` feature as an extension in older C modes
+and in C++. This type was previously implemented in Clang with the same
+semantics, but spelled ``_ExtInt(N)``. This spelling has been deprecated in
+favor of the standard type.
+
+Note: the ABI for ``_BitInt(N)`` is still in the process of being stabilized,
+so this type should not yet be used in interfaces that require ABI stability.
+
+C keywords supported in all language modes
+--
+
+Clang supports ``_Alignas``, ``_Alignof``, ``_Atomic``, ``_Complex``,
+``_Generic``, ``_Imaginary``, ``_Noreturn``, ``_Static_assert``,
+``_Thread_local``, ``_Float16``, ``_Decimal32``, ``_Decimal64`` and
+``_Decimal128`` in all language modes with the C semantics.
+
+__alignof, __alignof__
+--
+
+``__alignof`` and ``__alignof__`` return, in contrast to ``_Alignof`` and
+``alignof``, the preferred alignment of a type. This may be larger than the
+required alignment for improved performance.
+
+__extension__
+-
+
+``__extension__`` suppressed extension diagnostics in the statement it is
+prepended to.
+
+__auto_type
+---
+
+``__auto_type`` behaves the same as C++11s ``auto`` but is available in all
+language modes.
+
+__imag, __imag__
+
+
+``__imag`` and ``__imag__`` can be used to get the imaginary part of a complex
+value.
+
+__real, __real__
+
+
+``__real`` and ``__real__`` can be used to get the real part of a complex 
value.
+
+__asm, __asm__
+--
+
+``__asm`` and ``__asm__`` are alternate spellings for ``asm``, but available in
+all language modes.
+
+__complex, __complex__
+--
+
+``__complex`` and ``__complex__`` are alternate spellings for ``_Complex``.
+
+__const, __const__
+--
+
+``__const`` and ``__const__`` are alternate spellings for ``const``.
+
+__decltype
+--
+
+``__decltype`` is an alternate spelling for ``decltype``, but is also available
+in C++ modes before C++11.
+
+__inline, __inline__
+
+
+``__inline`` and ``__inline__`` are alternate spellings for ``inline``, but are
+available in all language modes.
+
+__nullptr
+-
+
+``__nullptr`` is an alternate spelling for ``nullptr``, but is also available 
in
+C++ modes before C++11.

philnik777 wrote:

Created #121503.

https://github.com/llvm/llvm-project/pull/84591
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2025-01-02 Thread Nikolas Klauser via cfe-commits

https://github.com/philnik777 edited 
https://github.com/llvm/llvm-project/pull/84591
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2025-01-02 Thread Nikolas Klauser via cfe-commits

https://github.com/philnik777 commented:

Sorry it took me so long to respond. I completely missed your review.

https://github.com/llvm/llvm-project/pull/84591
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2024-11-04 Thread Aaron Ballman via cfe-commits


@@ -433,6 +433,117 @@ __datasizeof
 ``__datasizeof`` behaves like ``sizeof``, except that it returns the size of 
the
 type ignoring tail padding.
 
+_BitInt, _ExtInt
+
+
+Clang supports the C23 ``_BitInt(N)`` feature as an extension in older C modes
+and in C++. This type was previously implemented in Clang with the same
+semantics, but spelled ``_ExtInt(N)``. This spelling has been deprecated in
+favor of the standard type.
+
+Note: the ABI for ``_BitInt(N)`` is still in the process of being stabilized,
+so this type should not yet be used in interfaces that require ABI stability.
+
+C keywords supported in all language modes
+--
+
+Clang supports ``_Alignas``, ``_Alignof``, ``_Atomic``, ``_Complex``,
+``_Generic``, ``_Imaginary``, ``_Noreturn``, ``_Static_assert``,
+``_Thread_local``, ``_Float16``, ``_Decimal32``, ``_Decimal64`` and
+``_Decimal128`` in all language modes with the C semantics.
+
+__alignof, __alignof__
+--
+
+``__alignof`` and ``__alignof__`` return, in contrast to ``_Alignof`` and
+``alignof``, the preferred alignment of a type. This may be larger than the
+required alignment for improved performance.
+
+__extension__
+-
+
+``__extension__`` suppressed extension diagnostics in the statement it is
+prepended to.
+
+__auto_type
+---
+
+``__auto_type`` behaves the same as C++11s ``auto`` but is available in all
+language modes.
+
+__imag, __imag__
+
+
+``__imag`` and ``__imag__`` can be used to get the imaginary part of a complex
+value.
+
+__real, __real__
+
+
+``__real`` and ``__real__`` can be used to get the real part of a complex 
value.
+
+__asm, __asm__
+--
+
+``__asm`` and ``__asm__`` are alternate spellings for ``asm``, but available in
+all language modes.
+
+__complex, __complex__
+--
+
+``__complex`` and ``__complex__`` are alternate spellings for ``_Complex``.
+
+__const, __const__
+--
+
+``__const`` and ``__const__`` are alternate spellings for ``const``.
+
+__decltype
+--
+
+``__decltype`` is an alternate spelling for ``decltype``, but is also available
+in C++ modes before C++11.
+
+__inline, __inline__
+
+
+``__inline`` and ``__inline__`` are alternate spellings for ``inline``, but are
+available in all language modes.
+
+__nullptr
+-
+
+``__nullptr`` is an alternate spelling for ``nullptr``, but is also available 
in
+C++ modes before C++11.
+
+__restrict, __restrict__

AaronBallman wrote:

Stick this with `const`?

https://github.com/llvm/llvm-project/pull/84591
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2024-11-04 Thread Aaron Ballman via cfe-commits


@@ -433,6 +433,117 @@ __datasizeof
 ``__datasizeof`` behaves like ``sizeof``, except that it returns the size of 
the
 type ignoring tail padding.
 
+_BitInt, _ExtInt
+
+
+Clang supports the C23 ``_BitInt(N)`` feature as an extension in older C modes
+and in C++. This type was previously implemented in Clang with the same
+semantics, but spelled ``_ExtInt(N)``. This spelling has been deprecated in
+favor of the standard type.
+
+Note: the ABI for ``_BitInt(N)`` is still in the process of being stabilized,
+so this type should not yet be used in interfaces that require ABI stability.
+
+C keywords supported in all language modes
+--
+
+Clang supports ``_Alignas``, ``_Alignof``, ``_Atomic``, ``_Complex``,
+``_Generic``, ``_Imaginary``, ``_Noreturn``, ``_Static_assert``,
+``_Thread_local``, ``_Float16``, ``_Decimal32``, ``_Decimal64`` and
+``_Decimal128`` in all language modes with the C semantics.

AaronBallman wrote:

The `_Decimal` variants are not supported yet: https://godbolt.org/z/noMe3KndK

https://github.com/llvm/llvm-project/pull/84591
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2024-11-04 Thread Aaron Ballman via cfe-commits

https://github.com/AaronBallman commented:

Thank you for working on this!

https://github.com/llvm/llvm-project/pull/84591
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2024-11-04 Thread Aaron Ballman via cfe-commits


@@ -433,6 +433,117 @@ __datasizeof
 ``__datasizeof`` behaves like ``sizeof``, except that it returns the size of 
the
 type ignoring tail padding.
 
+_BitInt, _ExtInt
+
+
+Clang supports the C23 ``_BitInt(N)`` feature as an extension in older C modes
+and in C++. This type was previously implemented in Clang with the same
+semantics, but spelled ``_ExtInt(N)``. This spelling has been deprecated in
+favor of the standard type.
+
+Note: the ABI for ``_BitInt(N)`` is still in the process of being stabilized,
+so this type should not yet be used in interfaces that require ABI stability.
+
+C keywords supported in all language modes
+--
+
+Clang supports ``_Alignas``, ``_Alignof``, ``_Atomic``, ``_Complex``,
+``_Generic``, ``_Imaginary``, ``_Noreturn``, ``_Static_assert``,
+``_Thread_local``, ``_Float16``, ``_Decimal32``, ``_Decimal64`` and
+``_Decimal128`` in all language modes with the C semantics.
+
+__alignof, __alignof__
+--
+
+``__alignof`` and ``__alignof__`` return, in contrast to ``_Alignof`` and
+``alignof``, the preferred alignment of a type. This may be larger than the
+required alignment for improved performance.
+
+__extension__
+-
+
+``__extension__`` suppressed extension diagnostics in the statement it is
+prepended to.
+
+__auto_type
+---
+
+``__auto_type`` behaves the same as C++11s ``auto`` but is available in all
+language modes.
+
+__imag, __imag__
+
+
+``__imag`` and ``__imag__`` can be used to get the imaginary part of a complex
+value.
+
+__real, __real__
+
+
+``__real`` and ``__real__`` can be used to get the real part of a complex 
value.
+
+__asm, __asm__
+--
+
+``__asm`` and ``__asm__`` are alternate spellings for ``asm``, but available in
+all language modes.
+
+__complex, __complex__
+--
+
+``__complex`` and ``__complex__`` are alternate spellings for ``_Complex``.
+
+__const, __const__
+--
+
+``__const`` and ``__const__`` are alternate spellings for ``const``.
+
+__decltype
+--
+
+``__decltype`` is an alternate spelling for ``decltype``, but is also available
+in C++ modes before C++11.
+
+__inline, __inline__
+
+
+``__inline`` and ``__inline__`` are alternate spellings for ``inline``, but are
+available in all language modes.
+
+__nullptr
+-
+
+``__nullptr`` is an alternate spelling for ``nullptr``, but is also available 
in
+C++ modes before C++11.
+
+__restrict, __restrict__
+
+
+``__restrict`` and ``__restrict__`` are alternate spellings for ``restrict``,
+but are available in all language modes.
+
+__signed, __signed__

AaronBallman wrote:

Should probably mention that we do not support `__unsigned__`, which certainly 
surprised me (neither does GCC)

https://github.com/llvm/llvm-project/pull/84591
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2024-11-04 Thread Aaron Ballman via cfe-commits


@@ -433,6 +433,117 @@ __datasizeof
 ``__datasizeof`` behaves like ``sizeof``, except that it returns the size of 
the
 type ignoring tail padding.
 
+_BitInt, _ExtInt
+
+
+Clang supports the C23 ``_BitInt(N)`` feature as an extension in older C modes
+and in C++. This type was previously implemented in Clang with the same
+semantics, but spelled ``_ExtInt(N)``. This spelling has been deprecated in
+favor of the standard type.
+
+Note: the ABI for ``_BitInt(N)`` is still in the process of being stabilized,
+so this type should not yet be used in interfaces that require ABI stability.
+
+C keywords supported in all language modes
+--
+
+Clang supports ``_Alignas``, ``_Alignof``, ``_Atomic``, ``_Complex``,
+``_Generic``, ``_Imaginary``, ``_Noreturn``, ``_Static_assert``,
+``_Thread_local``, ``_Float16``, ``_Decimal32``, ``_Decimal64`` and
+``_Decimal128`` in all language modes with the C semantics.
+
+__alignof, __alignof__
+--
+
+``__alignof`` and ``__alignof__`` return, in contrast to ``_Alignof`` and
+``alignof``, the preferred alignment of a type. This may be larger than the
+required alignment for improved performance.
+
+__extension__
+-
+
+``__extension__`` suppressed extension diagnostics in the statement it is
+prepended to.
+
+__auto_type
+---
+
+``__auto_type`` behaves the same as C++11s ``auto`` but is available in all
+language modes.
+
+__imag, __imag__
+
+
+``__imag`` and ``__imag__`` can be used to get the imaginary part of a complex
+value.
+
+__real, __real__
+
+
+``__real`` and ``__real__`` can be used to get the real part of a complex 
value.
+
+__asm, __asm__
+--
+
+``__asm`` and ``__asm__`` are alternate spellings for ``asm``, but available in
+all language modes.
+
+__complex, __complex__
+--
+
+``__complex`` and ``__complex__`` are alternate spellings for ``_Complex``.
+
+__const, __const__
+--
+
+``__const`` and ``__const__`` are alternate spellings for ``const``.
+
+__decltype
+--
+
+``__decltype`` is an alternate spelling for ``decltype``, but is also available
+in C++ modes before C++11.
+
+__inline, __inline__
+
+
+``__inline`` and ``__inline__`` are alternate spellings for ``inline``, but are
+available in all language modes.
+
+__nullptr
+-
+
+``__nullptr`` is an alternate spelling for ``nullptr``, but is also available 
in
+C++ modes before C++11.
+
+__restrict, __restrict__
+
+
+``__restrict`` and ``__restrict__`` are alternate spellings for ``restrict``,
+but are available in all language modes.
+
+__signed, __signed__
+
+
+``__signed`` and ``__signed__`` are alternate spellings for ``signed``.
+
+__typeof, __typeof__
+
+
+``__typeof`` and ``__typeof__`` are alternate spellings for ``typeof``, but are

AaronBallman wrote:

Should mention `typeof` in C23 and that all three of these get you the type 
information with qualifiers still attached.

https://github.com/llvm/llvm-project/pull/84591
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2024-11-04 Thread Aaron Ballman via cfe-commits


@@ -433,6 +433,117 @@ __datasizeof
 ``__datasizeof`` behaves like ``sizeof``, except that it returns the size of 
the
 type ignoring tail padding.
 
+_BitInt, _ExtInt
+
+
+Clang supports the C23 ``_BitInt(N)`` feature as an extension in older C modes
+and in C++. This type was previously implemented in Clang with the same
+semantics, but spelled ``_ExtInt(N)``. This spelling has been deprecated in
+favor of the standard type.
+
+Note: the ABI for ``_BitInt(N)`` is still in the process of being stabilized,
+so this type should not yet be used in interfaces that require ABI stability.
+
+C keywords supported in all language modes
+--
+
+Clang supports ``_Alignas``, ``_Alignof``, ``_Atomic``, ``_Complex``,
+``_Generic``, ``_Imaginary``, ``_Noreturn``, ``_Static_assert``,
+``_Thread_local``, ``_Float16``, ``_Decimal32``, ``_Decimal64`` and
+``_Decimal128`` in all language modes with the C semantics.
+
+__alignof, __alignof__
+--
+
+``__alignof`` and ``__alignof__`` return, in contrast to ``_Alignof`` and
+``alignof``, the preferred alignment of a type. This may be larger than the
+required alignment for improved performance.
+
+__extension__
+-
+
+``__extension__`` suppressed extension diagnostics in the statement it is
+prepended to.
+
+__auto_type
+---
+
+``__auto_type`` behaves the same as C++11s ``auto`` but is available in all
+language modes.
+
+__imag, __imag__
+
+
+``__imag`` and ``__imag__`` can be used to get the imaginary part of a complex
+value.
+
+__real, __real__
+
+
+``__real`` and ``__real__`` can be used to get the real part of a complex 
value.
+
+__asm, __asm__
+--
+
+``__asm`` and ``__asm__`` are alternate spellings for ``asm``, but available in
+all language modes.
+
+__complex, __complex__
+--
+
+``__complex`` and ``__complex__`` are alternate spellings for ``_Complex``.
+
+__const, __const__
+--
+
+``__const`` and ``__const__`` are alternate spellings for ``const``.
+
+__decltype
+--
+
+``__decltype`` is an alternate spelling for ``decltype``, but is also available
+in C++ modes before C++11.
+
+__inline, __inline__
+
+
+``__inline`` and ``__inline__`` are alternate spellings for ``inline``, but are
+available in all language modes.
+
+__nullptr
+-
+
+``__nullptr`` is an alternate spelling for ``nullptr``, but is also available 
in
+C++ modes before C++11.
+
+__restrict, __restrict__
+
+
+``__restrict`` and ``__restrict__`` are alternate spellings for ``restrict``,
+but are available in all language modes.
+
+__signed, __signed__
+
+
+``__signed`` and ``__signed__`` are alternate spellings for ``signed``.
+
+__typeof, __typeof__
+
+
+``__typeof`` and ``__typeof__`` are alternate spellings for ``typeof``, but are
+available in all langauge modes.
+
+__volatile, __volatile__
+
+
+``__volatile`` and ``__volatile__`` are alternate spellings for ``volatile``.
+
+__char16_t, __char32_t
+--
+
+``__char16_t`` and ``__char32_t`` are alternate spellings for ``char16_t`` and

AaronBallman wrote:

Should mention that these are C++-only and that `__char8_t` is not supported (I 
wonder why that is?)

https://github.com/llvm/llvm-project/pull/84591
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2024-11-04 Thread Aaron Ballman via cfe-commits


@@ -433,6 +433,117 @@ __datasizeof
 ``__datasizeof`` behaves like ``sizeof``, except that it returns the size of 
the
 type ignoring tail padding.
 
+_BitInt, _ExtInt
+
+
+Clang supports the C23 ``_BitInt(N)`` feature as an extension in older C modes
+and in C++. This type was previously implemented in Clang with the same
+semantics, but spelled ``_ExtInt(N)``. This spelling has been deprecated in
+favor of the standard type.
+
+Note: the ABI for ``_BitInt(N)`` is still in the process of being stabilized,
+so this type should not yet be used in interfaces that require ABI stability.
+
+C keywords supported in all language modes
+--
+
+Clang supports ``_Alignas``, ``_Alignof``, ``_Atomic``, ``_Complex``,
+``_Generic``, ``_Imaginary``, ``_Noreturn``, ``_Static_assert``,
+``_Thread_local``, ``_Float16``, ``_Decimal32``, ``_Decimal64`` and
+``_Decimal128`` in all language modes with the C semantics.
+
+__alignof, __alignof__
+--
+
+``__alignof`` and ``__alignof__`` return, in contrast to ``_Alignof`` and
+``alignof``, the preferred alignment of a type. This may be larger than the
+required alignment for improved performance.
+
+__extension__
+-
+
+``__extension__`` suppressed extension diagnostics in the statement it is
+prepended to.
+
+__auto_type
+---
+
+``__auto_type`` behaves the same as C++11s ``auto`` but is available in all

AaronBallman wrote:

```suggestion
``__auto_type`` behaves the same as ``auto`` in C++11 and C23 but is available 
in all
```

https://github.com/llvm/llvm-project/pull/84591
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2024-11-04 Thread Aaron Ballman via cfe-commits


@@ -433,6 +433,117 @@ __datasizeof
 ``__datasizeof`` behaves like ``sizeof``, except that it returns the size of 
the
 type ignoring tail padding.
 
+_BitInt, _ExtInt
+
+
+Clang supports the C23 ``_BitInt(N)`` feature as an extension in older C modes
+and in C++. This type was previously implemented in Clang with the same
+semantics, but spelled ``_ExtInt(N)``. This spelling has been deprecated in
+favor of the standard type.
+
+Note: the ABI for ``_BitInt(N)`` is still in the process of being stabilized,
+so this type should not yet be used in interfaces that require ABI stability.
+
+C keywords supported in all language modes
+--
+
+Clang supports ``_Alignas``, ``_Alignof``, ``_Atomic``, ``_Complex``,
+``_Generic``, ``_Imaginary``, ``_Noreturn``, ``_Static_assert``,
+``_Thread_local``, ``_Float16``, ``_Decimal32``, ``_Decimal64`` and
+``_Decimal128`` in all language modes with the C semantics.
+
+__alignof, __alignof__
+--
+
+``__alignof`` and ``__alignof__`` return, in contrast to ``_Alignof`` and
+``alignof``, the preferred alignment of a type. This may be larger than the
+required alignment for improved performance.
+
+__extension__
+-
+
+``__extension__`` suppressed extension diagnostics in the statement it is
+prepended to.
+
+__auto_type
+---
+
+``__auto_type`` behaves the same as C++11s ``auto`` but is available in all
+language modes.
+
+__imag, __imag__
+
+
+``__imag`` and ``__imag__`` can be used to get the imaginary part of a complex
+value.
+
+__real, __real__
+
+
+``__real`` and ``__real__`` can be used to get the real part of a complex 
value.
+
+__asm, __asm__
+--
+
+``__asm`` and ``__asm__`` are alternate spellings for ``asm``, but available in
+all language modes.
+
+__complex, __complex__
+--
+
+``__complex`` and ``__complex__`` are alternate spellings for ``_Complex``.
+
+__const, __const__
+--
+
+``__const`` and ``__const__`` are alternate spellings for ``const``.

AaronBallman wrote:

It might make sense to document all the cvr qualifiers together in one section?

https://github.com/llvm/llvm-project/pull/84591
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2024-11-04 Thread Aaron Ballman via cfe-commits


@@ -433,6 +433,117 @@ __datasizeof
 ``__datasizeof`` behaves like ``sizeof``, except that it returns the size of 
the
 type ignoring tail padding.
 
+_BitInt, _ExtInt
+
+
+Clang supports the C23 ``_BitInt(N)`` feature as an extension in older C modes
+and in C++. This type was previously implemented in Clang with the same
+semantics, but spelled ``_ExtInt(N)``. This spelling has been deprecated in
+favor of the standard type.
+
+Note: the ABI for ``_BitInt(N)`` is still in the process of being stabilized,
+so this type should not yet be used in interfaces that require ABI stability.
+
+C keywords supported in all language modes
+--
+
+Clang supports ``_Alignas``, ``_Alignof``, ``_Atomic``, ``_Complex``,
+``_Generic``, ``_Imaginary``, ``_Noreturn``, ``_Static_assert``,
+``_Thread_local``, ``_Float16``, ``_Decimal32``, ``_Decimal64`` and
+``_Decimal128`` in all language modes with the C semantics.
+
+__alignof, __alignof__
+--
+
+``__alignof`` and ``__alignof__`` return, in contrast to ``_Alignof`` and
+``alignof``, the preferred alignment of a type. This may be larger than the
+required alignment for improved performance.
+
+__extension__
+-
+
+``__extension__`` suppressed extension diagnostics in the statement it is

AaronBallman wrote:

```suggestion
``__extension__`` suppresses extension diagnostics in the statement it is
```

https://github.com/llvm/llvm-project/pull/84591
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2024-11-04 Thread Aaron Ballman via cfe-commits


@@ -433,6 +433,117 @@ __datasizeof
 ``__datasizeof`` behaves like ``sizeof``, except that it returns the size of 
the
 type ignoring tail padding.
 
+_BitInt, _ExtInt
+
+
+Clang supports the C23 ``_BitInt(N)`` feature as an extension in older C modes
+and in C++. This type was previously implemented in Clang with the same
+semantics, but spelled ``_ExtInt(N)``. This spelling has been deprecated in
+favor of the standard type.
+
+Note: the ABI for ``_BitInt(N)`` is still in the process of being stabilized,
+so this type should not yet be used in interfaces that require ABI stability.
+
+C keywords supported in all language modes
+--
+
+Clang supports ``_Alignas``, ``_Alignof``, ``_Atomic``, ``_Complex``,
+``_Generic``, ``_Imaginary``, ``_Noreturn``, ``_Static_assert``,
+``_Thread_local``, ``_Float16``, ``_Decimal32``, ``_Decimal64`` and
+``_Decimal128`` in all language modes with the C semantics.
+
+__alignof, __alignof__
+--
+
+``__alignof`` and ``__alignof__`` return, in contrast to ``_Alignof`` and
+``alignof``, the preferred alignment of a type. This may be larger than the
+required alignment for improved performance.
+
+__extension__
+-
+
+``__extension__`` suppressed extension diagnostics in the statement it is
+prepended to.
+
+__auto_type
+---
+
+``__auto_type`` behaves the same as C++11s ``auto`` but is available in all
+language modes.
+
+__imag, __imag__
+
+
+``__imag`` and ``__imag__`` can be used to get the imaginary part of a complex
+value.
+
+__real, __real__
+
+
+``__real`` and ``__real__`` can be used to get the real part of a complex 
value.
+
+__asm, __asm__
+--
+
+``__asm`` and ``__asm__`` are alternate spellings for ``asm``, but available in
+all language modes.
+
+__complex, __complex__
+--
+
+``__complex`` and ``__complex__`` are alternate spellings for ``_Complex``.
+
+__const, __const__
+--
+
+``__const`` and ``__const__`` are alternate spellings for ``const``.
+
+__decltype
+--
+
+``__decltype`` is an alternate spelling for ``decltype``, but is also available
+in C++ modes before C++11.
+
+__inline, __inline__
+
+
+``__inline`` and ``__inline__`` are alternate spellings for ``inline``, but are
+available in all language modes.
+
+__nullptr
+-
+
+``__nullptr`` is an alternate spelling for ``nullptr``, but is also available 
in
+C++ modes before C++11.
+
+__restrict, __restrict__
+
+
+``__restrict`` and ``__restrict__`` are alternate spellings for ``restrict``,
+but are available in all language modes.
+
+__signed, __signed__
+
+
+``__signed`` and ``__signed__`` are alternate spellings for ``signed``.
+
+__typeof, __typeof__
+
+
+``__typeof`` and ``__typeof__`` are alternate spellings for ``typeof``, but are
+available in all langauge modes.
+
+__volatile, __volatile__

AaronBallman wrote:

Stick this with `const`?

https://github.com/llvm/llvm-project/pull/84591
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2024-11-04 Thread Aaron Ballman via cfe-commits


@@ -433,6 +433,117 @@ __datasizeof
 ``__datasizeof`` behaves like ``sizeof``, except that it returns the size of 
the
 type ignoring tail padding.
 
+_BitInt, _ExtInt
+
+
+Clang supports the C23 ``_BitInt(N)`` feature as an extension in older C modes
+and in C++. This type was previously implemented in Clang with the same
+semantics, but spelled ``_ExtInt(N)``. This spelling has been deprecated in
+favor of the standard type.
+
+Note: the ABI for ``_BitInt(N)`` is still in the process of being stabilized,
+so this type should not yet be used in interfaces that require ABI stability.
+
+C keywords supported in all language modes
+--
+
+Clang supports ``_Alignas``, ``_Alignof``, ``_Atomic``, ``_Complex``,
+``_Generic``, ``_Imaginary``, ``_Noreturn``, ``_Static_assert``,
+``_Thread_local``, ``_Float16``, ``_Decimal32``, ``_Decimal64`` and
+``_Decimal128`` in all language modes with the C semantics.
+
+__alignof, __alignof__
+--
+
+``__alignof`` and ``__alignof__`` return, in contrast to ``_Alignof`` and
+``alignof``, the preferred alignment of a type. This may be larger than the
+required alignment for improved performance.
+
+__extension__
+-
+
+``__extension__`` suppressed extension diagnostics in the statement it is
+prepended to.
+
+__auto_type
+---
+
+``__auto_type`` behaves the same as C++11s ``auto`` but is available in all
+language modes.
+
+__imag, __imag__
+
+
+``__imag`` and ``__imag__`` can be used to get the imaginary part of a complex
+value.
+
+__real, __real__
+
+
+``__real`` and ``__real__`` can be used to get the real part of a complex 
value.
+
+__asm, __asm__
+--
+
+``__asm`` and ``__asm__`` are alternate spellings for ``asm``, but available in
+all language modes.
+
+__complex, __complex__
+--
+
+``__complex`` and ``__complex__`` are alternate spellings for ``_Complex``.
+
+__const, __const__
+--
+
+``__const`` and ``__const__`` are alternate spellings for ``const``.
+
+__decltype
+--
+
+``__decltype`` is an alternate spelling for ``decltype``, but is also available
+in C++ modes before C++11.
+
+__inline, __inline__
+
+
+``__inline`` and ``__inline__`` are alternate spellings for ``inline``, but are
+available in all language modes.
+
+__nullptr
+-
+
+``__nullptr`` is an alternate spelling for ``nullptr``, but is also available 
in
+C++ modes before C++11.

AaronBallman wrote:

Should note that this is currently only available in C++ modes, not C modes, 
despite C23 adding support for `nullptr`. I think this may be an oversight in 
C; perhaps worth filing a `good first issue` for it.

https://github.com/llvm/llvm-project/pull/84591
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2024-11-04 Thread Aaron Ballman via cfe-commits

https://github.com/AaronBallman edited 
https://github.com/llvm/llvm-project/pull/84591
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2024-03-08 Thread Nikolas Klauser via cfe-commits

https://github.com/philnik777 updated 
https://github.com/llvm/llvm-project/pull/84591

>From 634b8e8285b23201d7ad852ae35044d9b89c3c63 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser 
Date: Sat, 9 Mar 2024 02:14:36 +0100
Subject: [PATCH] [Clang] Document some of the implementation-defined keywords

---
 clang/docs/LanguageExtensions.rst | 122 +++---
 1 file changed, 111 insertions(+), 11 deletions(-)

diff --git a/clang/docs/LanguageExtensions.rst 
b/clang/docs/LanguageExtensions.rst
index 06af93fd3c15ca..2530d657be5996 100644
--- a/clang/docs/LanguageExtensions.rst
+++ b/clang/docs/LanguageExtensions.rst
@@ -433,6 +433,117 @@ __datasizeof
 ``__datasizeof`` behaves like ``sizeof``, except that it returns the size of 
the
 type ignoring tail padding.
 
+_BitInt, _ExtInt
+
+
+Clang supports the C23 ``_BitInt(N)`` feature as an extension in older C modes
+and in C++. This type was previously implemented in Clang with the same
+semantics, but spelled ``_ExtInt(N)``. This spelling has been deprecated in
+favor of the standard type.
+
+Note: the ABI for ``_BitInt(N)`` is still in the process of being stabilized,
+so this type should not yet be used in interfaces that require ABI stability.
+
+C keywords supported in all language modes
+--
+
+Clang supports ``_Alignas``, ``_Alignof``, ``_Atomic``, ``_Complex``,
+``_Generic``, ``_Imaginary``, ``_Noreturn``, ``_Static_assert``,
+``_Thread_local``, ``_Float16``, ``_Decimal32``, ``_Decimal64`` and
+``_Decimal128`` in all language modes with the C semantics.
+
+__alignof, __alignof__
+--
+
+``__alignof`` and ``__alignof__`` return, in contrast to ``_Alignof`` and
+``alignof``, the preferred alignment of a type. This may be larger than the
+required alignment for improved performance.
+
+__extension__
+-
+
+``__extension__`` suppressed extension diagnostics in the statement it is
+prepended to.
+
+__auto_type
+---
+
+``__auto_type`` behaves the same as C++11s ``auto`` but is available in all
+language modes.
+
+__imag, __imag__
+
+
+``__imag`` and ``__imag__`` can be used to get the imaginary part of a complex
+value.
+
+__real, __real__
+
+
+``__real`` and ``__real__`` can be used to get the real part of a complex 
value.
+
+__asm, __asm__
+--
+
+``__asm`` and ``__asm__`` are alternate spellings for ``asm``, but available in
+all language modes.
+
+__complex, __complex__
+--
+
+``__complex`` and ``__complex__`` are alternate spellings for ``_Complex``.
+
+__const, __const__
+--
+
+``__const`` and ``__const__`` are alternate spellings for ``const``.
+
+__decltype
+--
+
+``__decltype`` is an alternate spelling for ``decltype``, but is also available
+in C++ modes before C++11.
+
+__inline, __inline__
+
+
+``__inline`` and ``__inline__`` are alternate spellings for ``inline``, but are
+available in all language modes.
+
+__nullptr
+-
+
+``__nullptr`` is an alternate spelling for ``nullptr``, but is also available 
in
+C++ modes before C++11.
+
+__restrict, __restrict__
+
+
+``__restrict`` and ``__restrict__`` are alternate spellings for ``restrict``,
+but are available in all language modes.
+
+__signed, __signed__
+
+
+``__signed`` and ``__signed__`` are alternate spellings for ``signed``.
+
+__typeof, __typeof__
+
+
+``__typeof`` and ``__typeof__`` are alternate spellings for ``typeof``, but are
+available in all langauge modes.
+
+__volatile, __volatile__
+
+
+``__volatile`` and ``__volatile__`` are alternate spellings for ``volatile``.
+
+__char16_t, __char32_t
+--
+
+``__char16_t`` and ``__char32_t`` are alternate spellings for ``char16_t`` and
+``char32_t`` respectively, but are also available in C++ modes before C++11.
+
 ..
   FIXME: This should list all the keyword extensions
 
@@ -5319,17 +5430,6 @@ Examples are:
# 60 "" 2 // return to "main.c"
# 1 "/usr/ancient/header.h" 1 4 // Enter an implicit extern "C" header
 
-Extended Integer Types
-==
-
-Clang supports the C23 ``_BitInt(N)`` feature as an extension in older C modes
-and in C++. This type was previously implemented in Clang with the same
-semantics, but spelled ``_ExtInt(N)``. This spelling has been deprecated in
-favor of the standard type.
-
-Note: the ABI for ``_BitInt(N)`` is still in the process of being stabilized,
-so this type should not yet be used in interfaces that require ABI stability.
-
 Intrinsics Support within Constant Expressions
 ==
 

___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2024-03-08 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: Nikolas Klauser (philnik777)


Changes



---
Full diff: https://github.com/llvm/llvm-project/pull/84591.diff


1 Files Affected:

- (modified) clang/docs/LanguageExtensions.rst (+112-11) 


``diff
diff --git a/clang/docs/LanguageExtensions.rst 
b/clang/docs/LanguageExtensions.rst
index 06af93fd3c15ca..9c6c91c1cf4ba3 100644
--- a/clang/docs/LanguageExtensions.rst
+++ b/clang/docs/LanguageExtensions.rst
@@ -433,6 +433,118 @@ __datasizeof
 ``__datasizeof`` behaves like ``sizeof``, except that it returns the size of 
the
 type ignoring tail padding.
 
+_BitInt, _ExtInt
+
+
+Clang supports the C23 ``_BitInt(N)`` feature as an extension in older C modes
+and in C++. This type was previously implemented in Clang with the same
+semantics, but spelled ``_ExtInt(N)``. This spelling has been deprecated in
+favor of the standard type.
+
+Note: the ABI for ``_BitInt(N)`` is still in the process of being stabilized,
+so this type should not yet be used in interfaces that require ABI stability.
+
+C keywords supported in all language modes
+--
+
+Clang supports ``_Alignas``, ``_Alignof``, ``_Atomic``, ``_Complex``,
+``_Generic``, ``_Imaginary``, ``_Noreturn``, ``_Static_assert``,
+``_Thread_local``, ``_Float16``, ``_Decimal32``, ``_Decimal64`` and
+``_Decimal128`` in all language modes with the C semantics.
+
+__alignof, __alignof__
+-
+
+``__alignof`` and ``__alignof__`` return, in contrast to ``_Alignof`` and
+``alignof``, the preferred alignment of a type. This may be larger than the
+required alignment for improved performance.
+
+__extension__
+-
+
+``__extension__`` suppressed extension diagnostics in the statement it is
+prepended to.
+
+__auto_type
+---
+
+``__auto_type`` behaves the same as C++11s ``auto`` but is available in all
+language modes.
+
+__imag, __imag__
+
+
+``__imag`` and ``__imag__`` can be used to get the imaginary part of a complex
+value.
+
+__real, __real__
+
+
+``__real`` and ``__real__`` can be used to get the real part of a complex 
value.
+
+__asm, __asm__
+--
+
+``__asm`` and ``__asm__`` are alternate spellings for ``asm``, but available in
+all language modes.
+
+__complex, __complex__
+--
+
+``__complex`` and ``__complex__`` are alternate spellings for ``_Complex``.
+These are available for compatibility with old code.
+
+__const, __const__
+--
+
+``__const`` and ``__const__`` are alternate spellings for ``const``.
+
+__decltype
+--
+
+``__decltype`` is an alternate spelling for ``decltype``, but is also available
+in C++ modes before C++11.
+
+__inline, __inline__
+
+
+``__inline`` and ``__inline__`` are alternate spellings for ``inline``, but are
+available in all language modes.
+
+__nullptr
+-
+
+``__nullptr`` is an alternate spelling for ``nullptr``, but is also available 
in
+C++ modes before C++11.
+
+__restrict, __restrict__
+
+
+``__restrict`` and ``__restrict__`` are alternate spellings for ``restrict``,
+but are available in all language modes.
+
+__signed, __signed__
+
+
+``__signed`` and ``__signed__`` are alternate spellings for ``signed``.
+
+__typeof, __typeof__
+
+
+``__typeof`` and ``__typeof__`` are alternate spellings for ``typeof``, but are
+available in all langauge modes.
+
+__volatile, __volatile__
+
+
+``__volatile`` and ``__volatile__`` are alternate spellings for ``volatile``.
+
+__char16_t, __char32_t
+--
+
+``__char16_t`` and ``__char32_t`` are alternate spellings for ``char16_t`` and
+``char32_t`` respectively, but are also available in C++ modes before C++11.
+
 ..
   FIXME: This should list all the keyword extensions
 
@@ -5319,17 +5431,6 @@ Examples are:
# 60 "" 2 // return to "main.c"
# 1 "/usr/ancient/header.h" 1 4 // Enter an implicit extern "C" header
 
-Extended Integer Types
-==
-
-Clang supports the C23 ``_BitInt(N)`` feature as an extension in older C modes
-and in C++. This type was previously implemented in Clang with the same
-semantics, but spelled ``_ExtInt(N)``. This spelling has been deprecated in
-favor of the standard type.
-
-Note: the ABI for ``_BitInt(N)`` is still in the process of being stabilized,
-so this type should not yet be used in interfaces that require ABI stability.
-
 Intrinsics Support within Constant Expressions
 ==
 

``




https://github.com/llvm/llvm-project/pull/84591
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2024-03-08 Thread Nikolas Klauser via cfe-commits

https://github.com/philnik777 created 
https://github.com/llvm/llvm-project/pull/84591

None

>From 479b0dec7feb17beaccbdc029799f2333d979ce4 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser 
Date: Sat, 9 Mar 2024 02:14:36 +0100
Subject: [PATCH] [Clang] Document some of the implementation-defined keywords

---
 clang/docs/LanguageExtensions.rst | 123 +++---
 1 file changed, 112 insertions(+), 11 deletions(-)

diff --git a/clang/docs/LanguageExtensions.rst 
b/clang/docs/LanguageExtensions.rst
index 06af93fd3c15ca..9c6c91c1cf4ba3 100644
--- a/clang/docs/LanguageExtensions.rst
+++ b/clang/docs/LanguageExtensions.rst
@@ -433,6 +433,118 @@ __datasizeof
 ``__datasizeof`` behaves like ``sizeof``, except that it returns the size of 
the
 type ignoring tail padding.
 
+_BitInt, _ExtInt
+
+
+Clang supports the C23 ``_BitInt(N)`` feature as an extension in older C modes
+and in C++. This type was previously implemented in Clang with the same
+semantics, but spelled ``_ExtInt(N)``. This spelling has been deprecated in
+favor of the standard type.
+
+Note: the ABI for ``_BitInt(N)`` is still in the process of being stabilized,
+so this type should not yet be used in interfaces that require ABI stability.
+
+C keywords supported in all language modes
+--
+
+Clang supports ``_Alignas``, ``_Alignof``, ``_Atomic``, ``_Complex``,
+``_Generic``, ``_Imaginary``, ``_Noreturn``, ``_Static_assert``,
+``_Thread_local``, ``_Float16``, ``_Decimal32``, ``_Decimal64`` and
+``_Decimal128`` in all language modes with the C semantics.
+
+__alignof, __alignof__
+-
+
+``__alignof`` and ``__alignof__`` return, in contrast to ``_Alignof`` and
+``alignof``, the preferred alignment of a type. This may be larger than the
+required alignment for improved performance.
+
+__extension__
+-
+
+``__extension__`` suppressed extension diagnostics in the statement it is
+prepended to.
+
+__auto_type
+---
+
+``__auto_type`` behaves the same as C++11s ``auto`` but is available in all
+language modes.
+
+__imag, __imag__
+
+
+``__imag`` and ``__imag__`` can be used to get the imaginary part of a complex
+value.
+
+__real, __real__
+
+
+``__real`` and ``__real__`` can be used to get the real part of a complex 
value.
+
+__asm, __asm__
+--
+
+``__asm`` and ``__asm__`` are alternate spellings for ``asm``, but available in
+all language modes.
+
+__complex, __complex__
+--
+
+``__complex`` and ``__complex__`` are alternate spellings for ``_Complex``.
+These are available for compatibility with old code.
+
+__const, __const__
+--
+
+``__const`` and ``__const__`` are alternate spellings for ``const``.
+
+__decltype
+--
+
+``__decltype`` is an alternate spelling for ``decltype``, but is also available
+in C++ modes before C++11.
+
+__inline, __inline__
+
+
+``__inline`` and ``__inline__`` are alternate spellings for ``inline``, but are
+available in all language modes.
+
+__nullptr
+-
+
+``__nullptr`` is an alternate spelling for ``nullptr``, but is also available 
in
+C++ modes before C++11.
+
+__restrict, __restrict__
+
+
+``__restrict`` and ``__restrict__`` are alternate spellings for ``restrict``,
+but are available in all language modes.
+
+__signed, __signed__
+
+
+``__signed`` and ``__signed__`` are alternate spellings for ``signed``.
+
+__typeof, __typeof__
+
+
+``__typeof`` and ``__typeof__`` are alternate spellings for ``typeof``, but are
+available in all langauge modes.
+
+__volatile, __volatile__
+
+
+``__volatile`` and ``__volatile__`` are alternate spellings for ``volatile``.
+
+__char16_t, __char32_t
+--
+
+``__char16_t`` and ``__char32_t`` are alternate spellings for ``char16_t`` and
+``char32_t`` respectively, but are also available in C++ modes before C++11.
+
 ..
   FIXME: This should list all the keyword extensions
 
@@ -5319,17 +5431,6 @@ Examples are:
# 60 "" 2 // return to "main.c"
# 1 "/usr/ancient/header.h" 1 4 // Enter an implicit extern "C" header
 
-Extended Integer Types
-==
-
-Clang supports the C23 ``_BitInt(N)`` feature as an extension in older C modes
-and in C++. This type was previously implemented in Clang with the same
-semantics, but spelled ``_ExtInt(N)``. This spelling has been deprecated in
-favor of the standard type.
-
-Note: the ABI for ``_BitInt(N)`` is still in the process of being stabilized,
-so this type should not yet be used in interfaces that require ABI stability.
-
 Intrinsics Support within Constant Expressions
 ==
 

___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits