Skip to content

Commit 30a9b4e

Browse files
burblebeetkoeppe
authored andcommitted
CWG2650 Incorrect example for ill-formed non-type template arguments
The change from "struct" to "class" is accidentally missing from the paper P2710R0, but it was intended as part of the issue resolution, as confirmed by CWG. Fixes NB US 068 (C++23 CD).
1 parent 2cfab65 commit 30a9b4e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

source/templates.tex

+5-3
Original file line numberDiff line numberDiff line change
@@ -7329,9 +7329,11 @@
73297329
\begin{example}
73307330
\begin{codeblock}
73317331
template <class T, T> struct S {};
7332-
template <class T> int f(S<T, T()>*);
7333-
struct X {};
7334-
int i0 = f<X>(0);
7332+
template <class T> int f(S<T, T{}>*); // \#1
7333+
class X {
7334+
int m;
7335+
};
7336+
int i0 = f<X>(0); // \#1 uses a value of non-structural type \tcode{X} as a non-type template argument
73357337
\end{codeblock}
73367338
\end{example}
73377339

0 commit comments

Comments
 (0)