63 lines
3.1 KiB
Markdown
63 lines
3.1 KiB
Markdown
[lex.key]
|
||
|
||
# 5 Lexical conventions [[lex]](./#lex)
|
||
|
||
## 5.12 Keywords [lex.key]
|
||
|
||
[keyword:](#nt:keyword "5.12 Keywords [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.1 Attribute syntax and semantics [dcl.attr.grammar]") ([[dcl.attr.grammar]](dcl.attr.grammar "9.13.1 Attribute 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.9 Alternative 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 | |
|