You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a language construct is defined to produce an implicit call of a function, a use of the language construct is considered to be an expression for the purposes of this definition. Conversions applied to the result of an expression in order to satisfy the requirements of the language construct in which the expression appears are also considered to be part of the full-expression. For an initializer, performing the initialization of the entity (including evaluating default member initializers of an aggregate) is also considered part of the full-expression.
structS {
S(int i): I(i) { } // full-expression is initialization of Iint& v() { return I; }
~S() noexcept(false) { }
private:int I;
};
S s1(1); // full-expression comprises call of S::S(int)
According to the emphasized wording, the initialization of s1 can produce an implicit call of S::S(int), hence the initialization is considered to be an expression. We explicitly say the initialization would be part of the full-expression, however, we didn't explicitly say the implicit call is also considered to be part of that full-expression. Moreover, the case mentioned in [intro.execution] p6, it intends to say these default arguments are part of the full-expression, however, it is just a note, there is no normative rule that says that.
Should we say the subexpressions of an expression that is a part of a full-expression are also part of that full-expression? That would make the comment "full-expression comprises call of S::S(int)" as well as [intro.execution] p6 have a formal interpretation.
The text was updated successfully, but these errors were encountered:
xmh0511
changed the title
[intro.execution] p5 Which constructs does a full-expression include/comprise/contain
[intro.execution] p5 Which language constructs does a full-expression include/comprise/contain
Sep 26, 2021
[intro.execution] p5
According to the emphasized wording, the initialization of
s1
can produce an implicit call ofS::S(int)
, hence the initialization is considered to be an expression. We explicitly say the initialization would be part of the full-expression, however, we didn't explicitly say the implicit call is also considered to be part of that full-expression. Moreover, the case mentioned in [intro.execution] p6, it intends to say these default arguments are part of the full-expression, however, it is just a note, there is no normative rule that says that.Should we say the subexpressions of an expression that is a part of a full-expression are also part of that full-expression? That would make the comment "full-expression comprises call of S::S(int)" as well as [intro.execution] p6 have a formal interpretation.
The text was updated successfully, but these errors were encountered: