|
1917 | 1917 |
|
1918 | 1918 | \rSec2[diff.cpp17.special]{\ref{special}: special member functions}
|
1919 | 1919 |
|
1920 |
| -\diffrefs{class.ctor}{class.dtor} |
| 1920 | +\diffrefs{class.ctor}{class.conv.fct} |
1921 | 1921 | \change
|
1922 |
| -A \grammarterm{simple-template-id} |
1923 |
| -is no longer valid as the \grammarterm{declarator-id} of a constructor or destructor. |
| 1922 | +The class name can no longer be used parenthesized |
| 1923 | +immediately after an \tcode{explicit} \grammarterm{decl-specifier} |
| 1924 | +in a constructor declaration. |
| 1925 | +The \grammarterm{conversion-function-id} can no longer be used parenthesized |
| 1926 | +immediately after an \tcode{explicit} \grammarterm{decl-specifier} |
| 1927 | +in a conversion function declaration. |
1924 | 1928 | \rationale
|
1925 |
| -Remove potentially error-prone option for redundancy. |
| 1929 | +Necessary for new functionality. |
1926 | 1930 | \effect
|
1927 | 1931 | Valid \CppXVII{} code may fail to compile
|
1928 | 1932 | in this International Standard. For example:
|
1929 | 1933 | \begin{codeblock}
|
1930 |
| -template<class T> |
1931 |
| -struct A { |
1932 |
| - A<T>(); // error: \grammarterm{simple-template-id} not allowed for constructor |
1933 |
| - A(int); // OK, \grammarterm{injected-class-name} used |
1934 |
| - ~A<T>(); // error: \grammarterm{simple-template-id} not allowed for destructor |
| 1934 | +struct S { |
| 1935 | + explicit (S)(const S&); // ill-formed; previously well-formed |
| 1936 | + explicit (operator int)(); // ill-formed; previously well-formed |
| 1937 | + explicit(true) (S)(int); // OK |
1935 | 1938 | };
|
1936 | 1939 | \end{codeblock}
|
1937 | 1940 |
|
1938 |
| -\rSec2[diff.cpp17.decl]{\ref{dcl.decl}: declarators} |
1939 |
| - |
1940 |
| -\diffref{dcl.fct} |
| 1941 | +\diffrefs{class.ctor}{class.dtor} |
1941 | 1942 | \change
|
1942 |
| -The class name can no longer be used parenthesized |
1943 |
| -in an explicit constructor declaration. |
1944 |
| -The \grammarterm{conversion-function-id} can no longer be used parenthesized |
1945 |
| -in an explicit conversion function declaration. |
| 1943 | +A \grammarterm{simple-template-id} |
| 1944 | +is no longer valid as the \grammarterm{declarator-id} of a constructor or destructor. |
1946 | 1945 | \rationale
|
1947 |
| -Necessary for new functionality. |
| 1946 | +Remove potentially error-prone option for redundancy. |
1948 | 1947 | \effect
|
1949 | 1948 | Valid \CppXVII{} code may fail to compile
|
1950 | 1949 | in this International Standard. For example:
|
1951 | 1950 | \begin{codeblock}
|
1952 |
| -struct S { |
1953 |
| - explicit (S)(const S&); // ill-formed; previously well-formed |
1954 |
| - explicit (operator int)(); // ill-formed; previously well-formed |
| 1951 | +template<class T> |
| 1952 | +struct A { |
| 1953 | + A<T>(); // error: \grammarterm{simple-template-id} not allowed for constructor |
| 1954 | + A(int); // OK, \grammarterm{injected-class-name} used |
| 1955 | + ~A<T>(); // error: \grammarterm{simple-template-id} not allowed for destructor |
1955 | 1956 | };
|
1956 | 1957 | \end{codeblock}
|
1957 | 1958 |
|
|
0 commit comments