You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/cpp/language/main_function.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,7 +81,7 @@ The `main` function has several restrictions (violation of which renders the pro
81
81
- its address cannot be taken
82
82
- it cannot be used in a <Missing>`typeid`</Missing> expression <Revisionsince="C++11">or a <Missing>`decltype`</Missing> specifier</Revision>
83
83
- It cannot be predefined and cannot be overloaded: effectively, the name `main` in the global namespace is reserved for functions (although it can be used to name classes, namespaces, enumerations, and any entity in a non-global namespace, except that an entity named `main` cannot be declared with C <Missing>language linkage</Missing> in any namespace).
84
-
- It cannot be defined <Revisionsince="C++11">as deleted or</Revision> declared with any language linkage<Revisionsince="C++11">, <Missing>constexpr</Missing></Revision><Revisionsince="C++20">, <Missing>consteval</Missing></Revision>, <Missing>inline</Missing>, or <Missing>static</Missing>.
84
+
- It cannot be <Revisionsince="C++11">defined as deleted or</Revision> declared with any language linkage<Revisionsince="C++11">, <Missing>constexpr</Missing></Revision><Revisionsince="C++20">, <Missing>consteval</Missing></Revision>, <Missing>inline</Missing>, or <Missing>static</Missing>.
85
85
- <Revisionsince="C++14">The return type of the `main` function cannot be deduced (`auto main() {...}` is not allowed).</Revision>
86
86
- <Revisionsince="C++20">The `main` function cannot be a <Missing>coroutine</Missing>.</Revision>
87
87
- <Revisionsince="C++20">The `main` function cannot attach to a named <Missing>module</Missing>.</Revision>
0 commit comments