Skip to content

Commit 6beb496

Browse files
burblebeetkoeppe
authored andcommitted
CWG2650 Incorrect example for ill-formed non-type template arguments
Fixes NB US 068 (C++23 CD).
1 parent 8e4fd51 commit 6beb496

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)