diff --git a/specs/language/declarations.tex b/specs/language/declarations.tex index e63a86adf..46e8c5983 100644 --- a/specs/language/declarations.tex +++ b/specs/language/declarations.tex @@ -52,7 +52,7 @@ \begin{grammar} \define{function-specifier}\br - \texttt{export}\br + \terminal{export} \end{grammar} \p The \texttt{export} specifier denotes that the function has program linkage (\ref{Basic.Linkage.Program}). @@ -64,6 +64,36 @@ \p If a function is declared with an \texttt{export} specifier then all redeclarations of the same function must also use the \texttt{export} specifier or be part of \textit{export-declaration-group} (\ref{Decl.Export}). \Sec{Declarators}{Decl.Decl} + +\begin{grammar} + \define{init-declarator-list}\br + init-declarator\br + init-declarator-list \terminal{,} init-declarator\br + + \define{init-declarator}\br + declarator \opt{initializer}\br + + \define{declarator}\br + declarator-id \opt{attribute-specifier-seq}\br + declarator parameters-and-qualifiers\br + declarator \terminal{\lbrack} \opt{constant-expression} \terminal{\rbrack} \opt{attribute-specifier-seq}\br + + \define{parameters-and-qualifiers}\br + \terminal{(} parameter-declaration-clause \terminal{)} \opt{cv-qualifier-seq} \opt{attribute-specifier-seq}\br + + \define{cv-qualifier-seq}\br + cv-qualifier \opt{cv-qualifier-seq}\br + + \define{cv-qualifier}\br + \terminal{const}\br + + \define{declarator-id}\br + id-expression + +\end{grammar} + + + \Sec{Initializers}{Decl.Init} \p The process of initialization described in this section applies to all @@ -180,7 +210,7 @@ (\ref{Resources.cnbuf}). \p The cbuffer declaration itself does not declare a declaration scope. -Declarations within a cbuffer declaration that declare names, declare their names +Declarations within a cbuffer declaration that declare names, declare their names in the scope containing the cbuffer declaration. A cbuffer declaration may not contain a \textit{namespace-declaration} or \textit{cbuffer-declaration}. \footnote{These declarations were previously allowed in HLSL reference compilers diff --git a/specs/language/expressions.tex b/specs/language/expressions.tex index 0f32dd418..91e937d18 100644 --- a/specs/language/expressions.tex +++ b/specs/language/expressions.tex @@ -168,8 +168,9 @@ (\ref{Overload}).\footnote{HLSL does not support the base address of a subscript operator being the expression inside the braces, which is valid in C and C++.} -\p If the postfix expression \texttt{E1} is of vector type, the expression -\textit{E2} must be a value of integer type. If the value is known at compile +\p If the postfix expression \texttt{E1} is of array, vector or matrix type, the +expression \textit{E2} must be a value of integer type, or of a type that is +implicitly convertible to integer type. If the value is known at compile time to be outside the range \texttt{[0, N-1]} where \texttt{N} is the number of elements in the vector, the program is ill-formed. If the value is outside the range at runtime, the behavior is undefined. @@ -213,7 +214,7 @@ \textit{swizzle-component-xyzw} forms; the two forms may not be mixed in the same \textit{vector-swizzle-component-sequence}. The type of a swizzle expression is a vector of the same element type as the postfix expression before the dot, with a -number of elements equal to the number of components in the \textit{vector-swizzle-component-sequence}. +number of elements equal to the number of components in the \textit{vector-swizzle-component-sequence}. \p Vector swizzle components map to elements of the vector in the following way: @@ -270,7 +271,7 @@ \p A \textit{matrix-swizzle-component-sequence} is a sequence of one but less than or equal to four swizzle components of either the \textit{matrix-zero-indexed-swizzle} or \textit{matrix-one-indexed-swizzle} -forms; the two forms may not be mixed in the same +forms; the two forms may not be mixed in the same \textit{matrix-swizzle-component-sequence}. The type of a swizzle expression is a vector of the same element type as the postfix expression before the dot, with a number of elements equal to the number of components in the