From 598167b39d63ab3d1ef915d67219e314d9389d98 Mon Sep 17 00:00:00 2001 From: Gabriel Dos Reis Date: Thu, 3 Aug 2023 02:13:48 -0700 Subject: [PATCH] Describe `form.spec` partition (#98) Fix 89. --- ltx/decls.tex | 47 +++++++++++++++++++++++++++++++++++++++++++---- ltx/ifc.tex | 3 ++- 2 files changed, 45 insertions(+), 5 deletions(-) diff --git a/ltx/decls.tex b/ltx/decls.tex index 491885e..cf75482 100644 --- a/ltx/decls.tex +++ b/ltx/decls.tex @@ -675,7 +675,7 @@ \subsection{\valueTag{DeclSort::PartialSpecialization}} \DeclareMember{home\_scope}{DeclIndex} \\ \DeclareMember{chart}{ChartIndex} \\ \DeclareMember{entity}{ParameterizedEntity} \\ - \DeclareMember{form}{Index} \\ + \DeclareMember{form}{SpecFormIndex} \\ \DeclareMember{specifiers}{BasicSpecifiers} \\ \DeclareMember{access}{Access} \\ \DeclareMember{properties}{ReachableProperties} \\ @@ -689,7 +689,7 @@ \subsection{\valueTag{DeclSort::PartialSpecialization}} The \field{home\_scope} field denotes the parent declaration of this partial specialization. The \field{chart} field denotes the set of template-parameter lists of this partial specialization. The \field{entity} field describes the current instantiation of this partial specialization. -The \field{form} field is an index into the partition of specialization form (template and template-argument list) named \code{"form.spec"}. +The \field{form} field is an index into the partition of specialization form (template and template-argument list) named \code{"form.spec"} (\secref{sec:ifc-specialization-forms}). The \field{specifiers} field denotes the declaration specifiers of this partial specialization. The \field{access} field denotes the access level of this partial specialization. The \field{properties} field denotes the set of reachable semantic properties. @@ -709,7 +709,7 @@ \subsection{\valueTag{DeclSort::Specialization}} \begin{figure}[H] \centering \structure[text width = 14em]{ - \DeclareMember{form}{Index} \\ + \DeclareMember{form}{SpecFormIndex} \\ \DeclareMember{decl}{DeclIndex} \\ \DeclareMember{sort}{SpecializationSort} \\ } @@ -719,7 +719,7 @@ \subsection{\valueTag{DeclSort::Specialization}} % and meanings of the fields \begin{itemize} - \item The value of \field{form} is an index into the specialization form partition (named "form.spec"). + \item The value of \field{form} is an index into the specialization form partition (named "form.spec") (\secref{sec:ifc-specialization-forms}). \item \field{decl}, when non null, denotes the declaration produced by the specialization. \item \field{sort} designates how the specialization is obtained (\secref{sec:ifc-SpecializationSort}). \end{itemize} @@ -1451,3 +1451,42 @@ \subsubsection{Code segment type} \partition{decl.segment} \note{This is a vendor extension, the meta description of which is subject to change} + + +\section{Specialization forms} +\label{sec:ifc-specialization-forms} + +An explicit specialization or a partial specialization of a primary template declaration +provides an alternate implementation for a specialization request. +The semantic pattern for the \grammar{template-id} of such a specialization declaration is +stored in the specialization form partition. +Each entry in that partition is a structure with the following layout +% +\begin{figure}[H] + \centering + \structure{ + \DeclareMember{primary}{DeclIndex} \\ + \DeclareMember{arguments}{ExprIndex} \\ + } +\end{figure} +% +with the following meanings +\begin{itemize} + \item \field{primary} is an abstract reference designating the primary template declaration for which a specialization is provided + \item \field{arguments} designates the template-argument list to the \field{primary} declaration +\end{itemize} + +\partition{form.spec} + +\note{This representation is subject to change}. + +\subsection{Abstract reference for specialization forms} +\label{sec:ifc-spec-form-index} + +Specialization forms are referenced via abstract references of type \type{SpecForm}, +a $32$-bit value type defined as +% +\begin{typedef}{SpecFormIndex}{} + enum class SpecFormIndex : uint32_t { }; +\end{typedef} +% diff --git a/ltx/ifc.tex b/ltx/ifc.tex index 6de5a0b..c76bb6e 100644 --- a/ltx/ifc.tex +++ b/ltx/ifc.tex @@ -35,7 +35,8 @@ %% Turn off indentation of paragraph \setlength{\parindent}{0pt} -\addtocounter{secnumdepth}{1} +\setcounter{secnumdepth}{3} +%\addtocounter{secnumdepth}{1} \title{