Skip to content

Commit 4005215

Browse files
jensmaurertkoeppe
authored andcommitted
[expr.const] Amend comments in example
Fixes NB JP 023 (C++23 DIS).
1 parent 24b090f commit 4005215

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

source/expressions.tex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7984,12 +7984,13 @@
79847984

79857985
template<class T>
79867986
constexpr T h(T t = id(x)) { // \tcode{h<int>} is not an immediate function
7987+
// \tcode{id(x)} is not evaluated when parsing the default argument\iref{dcl.fct.default,temp.inst}
79877988
return t;
79887989
}
79897990

79907991
template<class T>
7991-
constexpr T hh() { // \tcode{hh<int>} is an immediate function
7992-
return h<T>();
7992+
constexpr T hh() { // \tcode{hh<int>} is an immediate function because of the invocation
7993+
return h<T>(); // of the immediate function \tcode{id} in the default argument of \tcode{h<int>}
79937994
}
79947995

79957996
int i = hh<int>(); // error: \tcode{hh<int>()} is an immediate-escalating expression

0 commit comments

Comments
 (0)