Files
2025-10-25 03:02:53 +03:00

63 lines
3.1 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[lex.key]
# 5 Lexical conventions [[lex]](./#lex)
## 5.12 Keywords [lex.key]
[keyword:](#nt:keyword "5.12Keywords[lex.key]")
any identifier listed in Table [5](#tab:lex.key "Table 5: Keywords")
*import-keyword*
*module-keyword*
*export-keyword*
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lex.tex#L1026)
The identifiers shown in Table [5](#tab:lex.key "Table 5: Keywords") are reserved for use
as keywords (that is, they are unconditionally treated as keywords in
phase 7) except in an [*attribute-token*](dcl.attr.grammar#nt:attribute-token "9.13.1Attribute syntax and semantics[dcl.attr.grammar]") ([[dcl.attr.grammar]](dcl.attr.grammar "9.13.1Attribute syntax and semantics"))[.](#1.sentence-1)
[*Note [1](#note-1)*:
The register keyword is unused but
is reserved for future use[.](#1.sentence-2)
— *end note*]
Table [5](#tab:lex.key) — Keywords [[tab:lex.key]](./tab:lex.key)
| [🔗](#tab:lex.key-row-1)<br>alignas | constinit | extern | protected | throw |
| --- | --- | --- | --- | --- |
| [🔗](#tab:lex.key-row-2)<br>alignof | const_cast | false | public | true |
| [🔗](#tab:lex.key-row-3)<br>asm | continue | float | register | try |
| [🔗](#tab:lex.key-row-4)<br>auto | contract_assert | for | reinterpret_cast | typedef |
| [🔗](#tab:lex.key-row-5)<br>bool | co_await | friend | requires | typeid |
| [🔗](#tab:lex.key-row-6)<br>break | co_return | goto | return | typename |
| [🔗](#tab:lex.key-row-7)<br>case | co_yield | if | short | union |
| [🔗](#tab:lex.key-row-8)<br>catch | decltype | inline | signed | unsigned |
| [🔗](#tab:lex.key-row-9)<br>char | default | int | sizeof | using |
| [🔗](#tab:lex.key-row-10)<br>char8_t | delete | long | static | virtual |
| [🔗](#tab:lex.key-row-11)<br>char16_t | do | mutable | static_assert | void |
| [🔗](#tab:lex.key-row-12)<br>char32_t | double | namespace | static_cast | volatile |
| [🔗](#tab:lex.key-row-13)<br>class | dynamic_cast | new | struct | wchar_t |
| [🔗](#tab:lex.key-row-14)<br>concept | else | noexcept | switch | while |
| [🔗](#tab:lex.key-row-15)<br>const | enum | nullptr | template | |
| [🔗](#tab:lex.key-row-16)<br>consteval | explicit | operator | this | |
| [🔗](#tab:lex.key-row-17)<br>constexpr | export | private | thread_local | |
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lex.tex#L1126)
Furthermore, the alternative representations shown in
Table [6](#tab:lex.key.digraph "Table 6: Alternative representations") for certain operators and
punctuators ([[lex.digraph]](lex.digraph "5.9Alternative tokens")) are reserved and shall not be used
otherwise[.](#2.sentence-1)
Table [6](#tab:lex.key.digraph) — Alternative representations [[tab:lex.key.digraph]](./tab:lex.key.digraph)
| [🔗](#tab:lex.key.digraph-row-1)<br>and | and_eq | bitand | bitor | compl | not |
| --- | --- | --- | --- | --- | --- |
| [🔗](#tab:lex.key.digraph-row-2)<br>not_eq | or | or_eq | xor | xor_eq | |