Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(do not merge) [cpp.predefined] Index predefined macros #7344

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions source/back.tex
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,15 @@
\printindex[conceptindex]
}

\clearpage
\renewcommand{\preindexhook}{The bold page number for each entry is the page
where the macro is defined.
Other page numbers refer to pages where the macro is mentioned in the general text.\\}
{
\raggedright
\printindex[macroindex]
}

\clearpage
\renewcommand{\preindexhook}{The entries in this index are rough descriptions; exact
specifications are at the indicated page in the general text.\\}
Expand Down
8 changes: 8 additions & 0 deletions source/macros.tex
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
\newcommand{\indexhdr}[1]{\index[headerindex]{\idxhdr{#1}}}
\newcommand{\indexconcept}[1]{\index[conceptindex]{#1}}
\newcommand{\indexgram}[1]{\index[grammarindex]{#1}}
\newcommand{\indexmacro}[1]{\index[macroindex]{#1}}

% Collation helper: When building an index key, replace all macro definitions
% in the key argument with a no-op for purposes of collation.
Expand Down Expand Up @@ -192,6 +193,7 @@
\newcommand{\idxcode}[1]{#1@\CodeStylex{#1}}
\newcommand{\idxconcept}[1]{#1@\CodeStylex{#1}}
\newcommand{\idxexposconcept}[1]{#1@\CodeStylex{\placeholder{#1}}}
\newcommand{\idxmacro}[1]{#1@\CodeStylex{#1}}
\newcommand{\idxhdr}[1]{#1@\CodeStylex{<#1>}}
\newcommand{\idxgram}[1]{#1@\gterm{#1}}
\newcommand{\idxterm}[1]{#1@\term{#1}}
Expand Down Expand Up @@ -504,6 +506,12 @@
\newcommand{\defexposconcept}[1]{\ecname{#1}\indexconcept{\idxexposconcept{#1}|idxbfpage}} % macro length: 16
\newcommand{\defexposconceptnc}[1]{\ecname{#1}\indexconcept{\idxexposconcept{#1}|idxbfpage}\itcorr[-1]} % macro length: 18

%% Macros
\newcommand{\macroname}[1]{\tcode{#1}}
\newcommand{\stdmacrox}[2]{\macroname{#1}\indexmacro{\idxmacro{#2}}}
\newcommand{\stdmacro}[1]{\stdmacrox{#1}{#1}}
\newcommand{\defstdmacro}[1]{\macroname{#1}\indexmacro{\idxmacro{#1}}\indexmacro{\idxmacro{#1}|idxbfpage}}

%% Ranges
\newcommand{\Range}[4]{\ensuremath{#1}\tcode{#3}\ensuremath{,}\,\penalty2000{}\tcode{#4}\ensuremath{#2}}
\newcommand{\crange}[2]{\Range{[}{]}{#1}{#2}}
Expand Down
179 changes: 90 additions & 89 deletions source/preprocessor.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@
\pnum
\indextext{__va_args__@\mname{VA_ARGS}}%
\indextext{__va_opt__@\mname{VA_OPT}}%
The identifiers \mname{VA_ARGS} and \mname{VA_OPT}
The identifiers \stdmacro{__VA_ARGS__} and \stdmacro{__VA_OPT__}
shall occur only in the \grammarterm{replacement-list}
of a function-like macro that uses the ellipsis notation in the parameters.

Expand Down Expand Up @@ -1191,6 +1191,7 @@
\indextext{argument substitution|see{macro, argument substitution}}%

\indextext{__va_opt__@\mname{VA_OPT}}%
%%\stdmacro{__VA_OPT__}%
\begin{bnf}
\nontermdef{va-opt-replacement}\br
\terminal{\mname{VA_OPT} (} \opt{pp-tokens} \terminal{)}
Expand Down Expand Up @@ -1228,7 +1229,7 @@

\pnum
\indextext{__va_args__@\mname{VA_ARGS}}%
An identifier \mname{VA_ARGS} that occurs in the replacement list
An identifier \stdmacro{__VA_ARGS__} that occurs in the replacement list
shall be treated as if it were a parameter, and the variable arguments shall form
the preprocessing tokens used to replace it.

Expand All @@ -1254,7 +1255,7 @@

\pnum
\indextext{__va_opt__@\mname{VA_OPT}}%
The identifier \mname{VA_OPT}
The identifier \stdmacro{__VA_OPT__}
shall always occur as part of the preprocessing token sequence
\grammarterm{va-opt-replacement};
its closing \tcode{)} is determined by skipping
Expand Down Expand Up @@ -1718,7 +1719,7 @@

\item
\indextext{__date__@\mname{DATE}}%
\mname{DATE}\\
\stdmacro{__DATE__}\\
The date of translation of the source file:
a character string literal of the form
\tcode{"Mmm~dd~yyyy"},
Expand All @@ -1735,7 +1736,7 @@

\item
\indextext{__file__@\mname{FILE}}%
\mname{FILE}\\
\stdmacro{__FILE__}\\
The presumed name of the current source file (a character string
literal).
\begin{footnote}
Expand All @@ -1744,7 +1745,7 @@

\item
\indextext{__line__@\mname{LINE}}%
\mname{LINE}\\
\stdmacro{__LINE__}\\
The presumed line number (within the current source file) of the current source line
(an integer literal).
\begin{footnote}
Expand All @@ -1755,15 +1756,15 @@
\indextext{__stdc_hosted__@\mname{STDC_HOSTED}}%
\indextext{implementation!hosted}%
\indextext{implementation!freestanding}%
\mname{STDC_HOSTED}\\
\stdmacro{__STDC_HOSTED__}\\
The integer literal \tcode{1}
if the implementation is a hosted implementation or
the integer literal \tcode{0}
if it is a freestanding implementation\iref{intro.compliance}.

\item
\indextext{__stdcpp_default_new_alignment__@\mname{STDCPP_DEFAULT_NEW_ALIGNMENT}}%
\mname{STDCPP_DEFAULT_NEW_ALIGNMENT}\\
\stdmacro{__STDCPP_DEFAULT_NEW_ALIGNMENT__}\\
An integer literal of type \tcode{std::size_t}
whose value is the alignment guaranteed
by a call to \tcode{operator new(std::size_t)}
Expand All @@ -1775,47 +1776,47 @@

\item
\indextext{__stdcpp_float16_t__@\mname{STDCPP_FLOAT16_T}}%
\mname{STDCPP_FLOAT16_T}\\
\stdmacro{__STDCPP_FLOAT16_T__}\\
Defined as the integer literal \tcode{1}
if and only if the implementation supports
the \IsoFloatUndated{} floating-point interchange format binary16
as an extended floating-point type\iref{basic.extended.fp}.

\item
\indextext{__stdcpp_float32_t__@\mname{STDCPP_FLOAT32_T}}%
\mname{STDCPP_FLOAT32_T}\\
\stdmacro{__STDCPP_FLOAT32_T__}\\
Defined as the integer literal \tcode{1}
if and only if the implementation supports
the \IsoFloatUndated{} floating-point interchange format binary32
as an extended floating-point type.

\item
\indextext{__stdcpp_float64_t__@\mname{STDCPP_FLOAT64_T}}%
\mname{STDCPP_FLOAT64_T}\\
\stdmacro{__STDCPP_FLOAT64_T__}\\
Defined as the integer literal \tcode{1}
if and only if the implementation supports
the \IsoFloatUndated{} floating-point interchange format binary64
as an extended floating-point type.

\item
\indextext{__stdcpp_float128_t__@\mname{STDCPP_FLOAT128_T}}%
\mname{STDCPP_FLOAT128_T}\\
\stdmacro{__STDCPP_FLOAT128_T__}\\
Defined as the integer literal \tcode{1}
if and only if the implementation supports
the \IsoFloatUndated{} floating-point interchange format binary128
as an extended floating-point type.

\item
\indextext{__stdcpp_bfloat16_t__@\mname{STDCPP_BFLOAT16_T}}%
\mname{STDCPP_BFLOAT16_T}\\
\stdmacro{__STDCPP_BFLOAT16_T__}\\
Defined as the integer literal \tcode{1}
if and only if the implementation supports an extended floating-point type
with the properties of the \grammarterm{typedef-name} \tcode{std::bfloat16_t}
as described in \ref{basic.extended.fp}.

\item
\indextext{__time__@\mname{TIME}}%
\mname{TIME}\\
\stdmacro{__TIME__}\\
The time of translation of the source file:
a character string literal of the form
\tcode{"hh:mm:ss"}
Expand All @@ -1836,76 +1837,76 @@
\hline
\lhdr{Name} & \rhdr{Value} \\ \capsep
\endhead
\defnxname{cpp_aggregate_bases} & \tcode{201603L} \\ \rowsep
\defnxname{cpp_aggregate_nsdmi} & \tcode{201304L} \\ \rowsep
\defnxname{cpp_aggregate_paren_init} & \tcode{201902L} \\ \rowsep
\defnxname{cpp_alias_templates} & \tcode{200704L} \\ \rowsep
\defnxname{cpp_aligned_new} & \tcode{201606L} \\ \rowsep
\defnxname{cpp_attributes} & \tcode{200809L} \\ \rowsep
\defnxname{cpp_auto_cast} & \tcode{202110L} \\ \rowsep
\defnxname{cpp_binary_literals} & \tcode{201304L} \\ \rowsep
\defnxname{cpp_capture_star_this} & \tcode{201603L} \\ \rowsep
\defnxname{cpp_char8_t} & \tcode{202207L} \\ \rowsep
\defnxname{cpp_concepts} & \tcode{202002L} \\ \rowsep
\defnxname{cpp_conditional_explicit} & \tcode{201806L} \\ \rowsep
\defnxname{cpp_constexpr} & \tcode{202406L} \\ \rowsep
\defnxname{cpp_constexpr_dynamic_alloc} & \tcode{201907L} \\ \rowsep
\defnxname{cpp_constexpr_in_decltype} & \tcode{201711L} \\ \rowsep
\defnxname{cpp_consteval} & \tcode{202211L} \\ \rowsep
\defnxname{cpp_constinit} & \tcode{201907L} \\ \rowsep
\defnxname{cpp_decltype} & \tcode{200707L} \\ \rowsep
\defnxname{cpp_decltype_auto} & \tcode{201304L} \\ \rowsep
\defnxname{cpp_deduction_guides} & \tcode{201907L} \\ \rowsep
\defnxname{cpp_delegating_constructors} & \tcode{200604L} \\ \rowsep
\defnxname{cpp_deleted_function} & \tcode{202403L} \\ \rowsep
\defnxname{cpp_designated_initializers} & \tcode{201707L} \\ \rowsep
\defnxname{cpp_enumerator_attributes} & \tcode{201411L} \\ \rowsep
\defnxname{cpp_explicit_this_parameter} & \tcode{202110L} \\ \rowsep
\defnxname{cpp_fold_expressions} & \tcode{201603L} \\ \rowsep
\defnxname{cpp_generic_lambdas} & \tcode{201707L} \\ \rowsep
\defnxname{cpp_guaranteed_copy_elision} & \tcode{201606L} \\ \rowsep
\defnxname{cpp_hex_float} & \tcode{201603L} \\ \rowsep
\defnxname{cpp_if_consteval} & \tcode{202106L} \\ \rowsep
\defnxname{cpp_if_constexpr} & \tcode{201606L} \\ \rowsep
\defnxname{cpp_impl_coroutine} & \tcode{201902L} \\ \rowsep
\defnxname{cpp_impl_destroying_delete} & \tcode{201806L} \\ \rowsep
\defnxname{cpp_impl_three_way_comparison} & \tcode{201907L} \\ \rowsep
\defnxname{cpp_implicit_move} & \tcode{202207L} \\ \rowsep
\defnxname{cpp_inheriting_constructors} & \tcode{201511L} \\ \rowsep
\defnxname{cpp_init_captures} & \tcode{201803L} \\ \rowsep
\defnxname{cpp_initializer_lists} & \tcode{200806L} \\ \rowsep
\defnxname{cpp_inline_variables} & \tcode{201606L} \\ \rowsep
\defnxname{cpp_lambdas} & \tcode{200907L} \\ \rowsep
\defnxname{cpp_modules} & \tcode{201907L} \\ \rowsep
\defnxname{cpp_multidimensional_subscript} & \tcode{202211L} \\ \rowsep
\defnxname{cpp_named_character_escapes} & \tcode{202207L} \\ \rowsep
\defnxname{cpp_namespace_attributes} & \tcode{201411L} \\ \rowsep
\defnxname{cpp_noexcept_function_type} & \tcode{201510L} \\ \rowsep
\defnxname{cpp_nontype_template_args} & \tcode{201911L} \\ \rowsep
\defnxname{cpp_nontype_template_parameter_auto} & \tcode{201606L} \\ \rowsep
\defnxname{cpp_nsdmi} & \tcode{200809L} \\ \rowsep
\defnxname{cpp_pack_indexing} & \tcode{202311L} \\ \rowsep
\defnxname{cpp_placeholder_variables} & \tcode{202306L} \\ \rowsep
\defnxname{cpp_range_based_for} & \tcode{202211L} \\ \rowsep
\defnxname{cpp_raw_strings} & \tcode{200710L} \\ \rowsep
\defnxname{cpp_ref_qualifiers} & \tcode{200710L} \\ \rowsep
\defnxname{cpp_return_type_deduction} & \tcode{201304L} \\ \rowsep
\defnxname{cpp_rvalue_references} & \tcode{200610L} \\ \rowsep
\defnxname{cpp_size_t_suffix} & \tcode{202011L} \\ \rowsep
\defnxname{cpp_sized_deallocation} & \tcode{201309L} \\ \rowsep
\defnxname{cpp_static_assert} & \tcode{202306L} \\ \rowsep
\defnxname{cpp_static_call_operator} & \tcode{202207L} \\ \rowsep
\defnxname{cpp_structured_bindings} & \tcode{202403L} \\ \rowsep
\defnxname{cpp_template_template_args} & \tcode{201611L} \\ \rowsep
\defnxname{cpp_threadsafe_static_init} & \tcode{200806L} \\ \rowsep
\defnxname{cpp_unicode_characters} & \tcode{200704L} \\ \rowsep
\defnxname{cpp_unicode_literals} & \tcode{200710L} \\ \rowsep
\defnxname{cpp_user_defined_literals} & \tcode{200809L} \\ \rowsep
\defnxname{cpp_using_enum} & \tcode{201907L} \\ \rowsep
\defnxname{cpp_variable_templates} & \tcode{201304L} \\ \rowsep
\defnxname{cpp_variadic_friend} & \tcode{202403L} \\ \rowsep
\defnxname{cpp_variadic_templates} & \tcode{200704L} \\ \rowsep
\defnxname{cpp_variadic_using} & \tcode{201611L} \\
\defstdmacro{__cpp_aggregate_bases} & \tcode{201603L} \\ \rowsep
\defstdmacro{__cpp_aggregate_nsdmi} & \tcode{201304L} \\ \rowsep
\defstdmacro{__cpp_aggregate_paren_init} & \tcode{201902L} \\ \rowsep
\defstdmacro{__cpp_alias_templates} & \tcode{200704L} \\ \rowsep
\defstdmacro{__cpp_aligned_new} & \tcode{201606L} \\ \rowsep
\defstdmacro{__cpp_attributes} & \tcode{200809L} \\ \rowsep
\defstdmacro{__cpp_auto_cast} & \tcode{202110L} \\ \rowsep
\defstdmacro{__cpp_binary_literals} & \tcode{201304L} \\ \rowsep
\defstdmacro{__cpp_capture_star_this} & \tcode{201603L} \\ \rowsep
\defstdmacro{__cpp_char8_t} & \tcode{202207L} \\ \rowsep
\defstdmacro{__cpp_concepts} & \tcode{202002L} \\ \rowsep
\defstdmacro{__cpp_conditional_explicit} & \tcode{201806L} \\ \rowsep
\defstdmacro{__cpp_constexpr} & \tcode{202406L} \\ \rowsep
\defstdmacro{__cpp_constexpr_dynamic_alloc} & \tcode{201907L} \\ \rowsep
\defstdmacro{__cpp_constexpr_in_decltype} & \tcode{201711L} \\ \rowsep
\defstdmacro{__cpp_consteval} & \tcode{202211L} \\ \rowsep
\defstdmacro{__cpp_constinit} & \tcode{201907L} \\ \rowsep
\defstdmacro{__cpp_decltype} & \tcode{200707L} \\ \rowsep
\defstdmacro{__cpp_decltype_auto} & \tcode{201304L} \\ \rowsep
\defstdmacro{__cpp_deduction_guides} & \tcode{201907L} \\ \rowsep
\defstdmacro{__cpp_delegating_constructors} & \tcode{200604L} \\ \rowsep
\defstdmacro{__cpp_deleted_function} & \tcode{202403L} \\ \rowsep
\defstdmacro{__cpp_designated_initializers} & \tcode{201707L} \\ \rowsep
\defstdmacro{__cpp_enumerator_attributes} & \tcode{201411L} \\ \rowsep
\defstdmacro{__cpp_explicit_this_parameter} & \tcode{202110L} \\ \rowsep
\defstdmacro{__cpp_fold_expressions} & \tcode{201603L} \\ \rowsep
\defstdmacro{__cpp_generic_lambdas} & \tcode{201707L} \\ \rowsep
\defstdmacro{__cpp_guaranteed_copy_elision} & \tcode{201606L} \\ \rowsep
\defstdmacro{__cpp_hex_float} & \tcode{201603L} \\ \rowsep
\defstdmacro{__cpp_if_consteval} & \tcode{202106L} \\ \rowsep
\defstdmacro{__cpp_if_constexpr} & \tcode{201606L} \\ \rowsep
\defstdmacro{__cpp_impl_coroutine} & \tcode{201902L} \\ \rowsep
\defstdmacro{__cpp_impl_destroying_delete} & \tcode{201806L} \\ \rowsep
\defstdmacro{__cpp_impl_three_way_comparison} & \tcode{201907L} \\ \rowsep
\defstdmacro{__cpp_implicit_move} & \tcode{202207L} \\ \rowsep
\defstdmacro{__cpp_inheriting_constructors} & \tcode{201511L} \\ \rowsep
\defstdmacro{__cpp_init_captures} & \tcode{201803L} \\ \rowsep
\defstdmacro{__cpp_initializer_lists} & \tcode{200806L} \\ \rowsep
\defstdmacro{__cpp_inline_variables} & \tcode{201606L} \\ \rowsep
\defstdmacro{__cpp_lambdas} & \tcode{200907L} \\ \rowsep
\defstdmacro{__cpp_modules} & \tcode{201907L} \\ \rowsep
\defstdmacro{__cpp_multidimensional_subscript} & \tcode{202211L} \\ \rowsep
\defstdmacro{__cpp_named_character_escapes} & \tcode{202207L} \\ \rowsep
\defstdmacro{__cpp_namespace_attributes} & \tcode{201411L} \\ \rowsep
\defstdmacro{__cpp_noexcept_function_type} & \tcode{201510L} \\ \rowsep
\defstdmacro{__cpp_nontype_template_args} & \tcode{201911L} \\ \rowsep
\defstdmacro{__cpp_nontype_template_parameter_auto} & \tcode{201606L} \\ \rowsep
\defstdmacro{__cpp_nsdmi} & \tcode{200809L} \\ \rowsep
\defstdmacro{__cpp_pack_indexing} & \tcode{202311L} \\ \rowsep
\defstdmacro{__cpp_placeholder_variables} & \tcode{202306L} \\ \rowsep
\defstdmacro{__cpp_range_based_for} & \tcode{202211L} \\ \rowsep
\defstdmacro{__cpp_raw_strings} & \tcode{200710L} \\ \rowsep
\defstdmacro{__cpp_ref_qualifiers} & \tcode{200710L} \\ \rowsep
\defstdmacro{__cpp_return_type_deduction} & \tcode{201304L} \\ \rowsep
\defstdmacro{__cpp_rvalue_references} & \tcode{200610L} \\ \rowsep
\defstdmacro{__cpp_size_t_suffix} & \tcode{202011L} \\ \rowsep
\defstdmacro{__cpp_sized_deallocation} & \tcode{201309L} \\ \rowsep
\defstdmacro{__cpp_static_assert} & \tcode{202306L} \\ \rowsep
\defstdmacro{__cpp_static_call_operator} & \tcode{202207L} \\ \rowsep
\defstdmacro{__cpp_structured_bindings} & \tcode{202403L} \\ \rowsep
\defstdmacro{__cpp_template_template_args} & \tcode{201611L} \\ \rowsep
\defstdmacro{__cpp_threadsafe_static_init} & \tcode{200806L} \\ \rowsep
\defstdmacro{__cpp_unicode_characters} & \tcode{200704L} \\ \rowsep
\defstdmacro{__cpp_unicode_literals} & \tcode{200710L} \\ \rowsep
\defstdmacro{__cpp_user_defined_literals} & \tcode{200809L} \\ \rowsep
\defstdmacro{__cpp_using_enum} & \tcode{201907L} \\ \rowsep
\defstdmacro{__cpp_variable_templates} & \tcode{201304L} \\ \rowsep
\defstdmacro{__cpp_variadic_friend} & \tcode{202403L} \\ \rowsep
\defstdmacro{__cpp_variadic_templates} & \tcode{200704L} \\ \rowsep
\defstdmacro{__cpp_variadic_using} & \tcode{201611L} \\
\end{LongTable}

\pnum
Expand All @@ -1914,26 +1915,26 @@
\begin{description}
\item
\indextext{__stdc__@\mname{STDC}}%
\mname{STDC}\\
\stdmacro{__STDC__}\\
Whether \mname{STDC} is predefined and if so, what its value is,
are \impldef{definition and meaning of \mname{STDC}}.

\item
\indextext{__stdc_mb_might_neq_wc__@\mname{STDC_MB_MIGHT_NEQ_WC}}%
\mname{STDC_MB_MIGHT_NEQ_WC}\\
\stdmacro{__STDC_MB_MIGHT_NEQ_WC__}\\
The integer literal \tcode{1}, intended to indicate that, in the encoding for
\keyword{wchar_t}, a member of the basic character set need not have a code value equal to
its value when used as the lone character in an ordinary character literal.

\item
\indextext{__stdc_version__@\mname{STDC_VERSION}}%
\mname{STDC_VERSION}\\
\stdmacro{__STDC_VERSION__}\\
Whether \mname{STDC_VERSION} is predefined and if so, what its value is,
are \impldef{definition and meaning of \mname{STDC_VERSION}}.

\item
\indextext{__stdc_iso_10646__@\mname{STDC_ISO_10646}}%
\mname{STDC_ISO_10646}\\
\stdmacro{__STDC_ISO_10646__}\\
An integer literal of the form \tcode{yyyymmL}
(for example, \tcode{199712L}).
Whether \mname{STDC_ISO_10646} is predefined and
Expand All @@ -1942,7 +1943,7 @@

\item
\indextext{__stdcpp_threads__@\mname{STDCPP_THREADS}}%
\mname{STDCPP_THREADS}\\
\stdmacro{__STDCPP_THREADS__}\\
Defined, and has the value integer literal 1, if and only if a program
can have more than one thread of execution\iref{intro.multithread}.

Expand Down
1 change: 1 addition & 0 deletions source/std.tex
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
\makeindex[name=headerindex,title=Index of library headers]
\makeindex[name=libraryindex,options=-s libraryindex.ist,title=Index of library names]
\makeindex[name=conceptindex,title=Index of library concepts]
\makeindex[name=macroindex,title=Index of macro names]
\makeindex[name=impldefindex,title=Index of implementation-defined behavior]
\makeglossary[xrefindex]
\makeglossary[xrefdelta]
Expand Down
Loading