|
1325 | 1325 | \begin{bnf} |
1326 | 1326 | \nontermdef{id-expression}\br |
1327 | 1327 | unqualified-id\br |
1328 | | - qualified-id |
| 1328 | + qualified-id\br |
| 1329 | + pack-index-expression |
1329 | 1330 | \end{bnf} |
1330 | 1331 |
|
1331 | 1332 | \pnum |
|
1430 | 1431 | conversion-function-id\br |
1431 | 1432 | literal-operator-id\br |
1432 | 1433 | \terminal{\~} type-name\br |
1433 | | - \terminal{\~} decltype-specifier\br |
| 1434 | + \terminal{\~} computed-type-specifier\br |
1434 | 1435 | template-id |
1435 | 1436 | \end{bnf} |
1436 | 1437 |
|
|
1447 | 1448 | \grammarterm{conversion-function-id}{s}, see~\ref{class.conv.fct}; for |
1448 | 1449 | \grammarterm{literal-operator-id}{s}, see~\ref{over.literal}; for |
1449 | 1450 | \grammarterm{template-id}{s}, see~\ref{temp.names}. |
1450 | | -A \grammarterm{type-name} or \grammarterm{decltype-specifier} |
| 1451 | +A \grammarterm{type-name} or \grammarterm{computed-type-specifier} |
1451 | 1452 | prefixed by \tcode{\~} denotes the destructor of the type so named; |
1452 | 1453 | see~\ref{expr.prim.id.dtor}. |
1453 | 1454 | Within the definition of a non-static member function, an |
|
1595 | 1596 | \terminal{::}\br |
1596 | 1597 | type-name \terminal{::}\br |
1597 | 1598 | namespace-name \terminal{::}\br |
1598 | | - decltype-specifier \terminal{::}\br |
| 1599 | + computed-type-specifier \terminal{::}\br |
1599 | 1600 | nested-name-specifier identifier \terminal{::}\br |
1600 | 1601 | nested-name-specifier \opt{\keyword{template}} simple-template-id \terminal{::} |
1601 | 1602 | \end{bnf} |
|
1633 | 1634 | \pnum |
1634 | 1635 | The \grammarterm{nested-name-specifier} \tcode{::} nominates |
1635 | 1636 | the global namespace. |
1636 | | -A \grammarterm{nested-name-specifier} with a \grammarterm{decltype-specifier} |
1637 | | -nominates the type denoted by the \grammarterm{decltype-specifier}, |
| 1637 | +A \grammarterm{nested-name-specifier} with a \grammarterm{computed-type-specifier} |
| 1638 | +nominates the type denoted by the \grammarterm{computed-type-specifier}, |
1638 | 1639 | which shall be a class or enumeration type. |
1639 | 1640 | If a \grammarterm{nested-name-specifier} $N$ |
1640 | 1641 | is declarative and |
|
1666 | 1667 | \pnum |
1667 | 1668 | A \grammarterm{qualified-id} shall not be of the form |
1668 | 1669 | \grammarterm{nested-name-specifier} \opt{\keyword{template}} \tcode{\~} |
1669 | | -\grammarterm{decltype-specifier} |
| 1670 | +\grammarterm{computed-type-specifier} |
1670 | 1671 | nor of the form |
1671 | | -\grammarterm{decltype-specifier} \tcode{::} \tcode{\~} \grammarterm{type-name}. |
| 1672 | +\grammarterm{computed-type-specifier} \tcode{::} \tcode{\~} \grammarterm{type-name}. |
1672 | 1673 |
|
1673 | 1674 | \pnum |
1674 | 1675 | The result of a \grammarterm{qualified-id} $Q$ is |
|
1690 | 1691 | \end{itemize} |
1691 | 1692 | and a prvalue otherwise. |
1692 | 1693 |
|
| 1694 | +\rSec3[expr.prim.pack.index]{Pack indexing expression} |
| 1695 | + |
| 1696 | +\begin{bnf} |
| 1697 | +\nontermdef{pack-index-expression}\br |
| 1698 | + id-expression \terminal{...} \terminal{[} constant-expression \terminal{]} |
| 1699 | +\end{bnf} |
| 1700 | + |
| 1701 | +\pnum |
| 1702 | +The \grammarterm{id-expression} $P$ in a \grammarterm{pack-index-expression} |
| 1703 | +shall be an \grammarterm{identifier} that denotes a pack. |
| 1704 | + |
| 1705 | +\pnum |
| 1706 | +The \grammarterm{constant-expression} shall be |
| 1707 | +a converted constant expression\iref{expr.const} of type \tcode{std::size_t} |
| 1708 | +whose value $V$, termed the index, |
| 1709 | +is such that $0 \le V < \tcode{sizeof...(}P\tcode{)}$. |
| 1710 | + |
| 1711 | +\pnum |
| 1712 | +A \grammarterm{pack-index-expression} is a pack expansion\iref{temp.variadic}. |
| 1713 | + |
| 1714 | +\pnum |
| 1715 | +\begin{note} |
| 1716 | +A \grammarterm{pack-index-expression} denotes |
| 1717 | +the $V^\tcode{th}$ element of the pack\iref{temp.variadic}. |
| 1718 | +\end{note} |
| 1719 | + |
1693 | 1720 | \rSec3[expr.prim.id.dtor]{Destruction} |
1694 | 1721 |
|
1695 | 1722 | \pnum |
|
4689 | 4716 | \end{note} |
4690 | 4717 | There is an ambiguity |
4691 | 4718 | in the grammar when \tcode{\~{}} is followed by |
4692 | | -a \grammarterm{type-name} or \grammarterm{decltype-specifier}. |
| 4719 | +a \grammarterm{type-name} or \grammarterm{computed-type-specifier}. |
4693 | 4720 | The ambiguity is resolved by treating \tcode{\~{}} as the |
4694 | 4721 | operator rather than as the start of an \grammarterm{unqualified-id} |
4695 | 4722 | naming a destructor. |
4696 | 4723 | \begin{note} |
4697 | 4724 | Because the grammar does not permit an operator to follow the |
4698 | 4725 | \tcode{.}, \tcode{->}, or \tcode{::} tokens, a \tcode{\~{}} followed by |
4699 | | -a \grammarterm{type-name} or \grammarterm{decltype-specifier} in a |
| 4726 | +a \grammarterm{type-name} or \grammarterm{computed-type-specifier} in a |
4700 | 4727 | member access expression or \grammarterm{qualified-id} is |
4701 | 4728 | unambiguously parsed as a destructor name. |
4702 | 4729 | \end{note} |
|
0 commit comments