Skip to content

Commit 9d9396a

Browse files
committed
CWG2650 Incorrect example for ill-formed non-type template arguments
Also fixes NB US 28-068 (C++23 CD).
1 parent acd9e03 commit 9d9396a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

source/templates.tex

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7290,9 +7290,11 @@
72907290
\begin{example}
72917291
\begin{codeblock}
72927292
template <class T, T> struct S {};
7293-
template <class T> int f(S<T, T()>*);
7294-
struct X {};
7295-
int i0 = f<X>(0);
7293+
template <class T> int f(S<T, T{}>*); // \#1
7294+
struct X {
7295+
int m;
7296+
};
7297+
int i0 = f<X>(0); // \#1 uses a value of non-structural type \tcode{X} as a non-type template argument
72967298
\end{codeblock}
72977299
\end{example}
72987300

0 commit comments

Comments
 (0)