Created on 2023-04-02.00:00:00 last changed 12 months ago
Proposed resolution (approved by CWG 2023-04-28):
Change in 7.6.1.3 [expr.call] paragraph 6 as follows:
... The initialization and destruction of each parameter occurs within the context of thecalling functionfull-expression (6.9.1 [intro.execution]) where the function call appears. [Example 2: The access (11.8.1 [class.access.general]) of the constructor, conversion functions, or destructor is checked at the point of callin the calling function. If a constructor or destructor for a function parameter throws an exception,the search for a handler starts in the calling function; in particular, if the function called has aany function-try-block (14.1 [except.pre]) of the called function with a handler that can handle the exception, this handleris not considered. —end example]
[Accepted as a DR at the June, 2023 meeting.]
Subclause 7.6.1.3 [expr.call] paragraph 6 specifies:
... The initialization and destruction of each parameter occurs within the context of the calling function. [Example 2: The access of the constructor, conversion functions or destructor is checked at the point of call in the calling function. If a constructor or destructor for a function parameter throws an exception, the search for a handler starts in the calling function; in particular, if the function called has a function-try-block (14.1 [except.pre]) with a handler that can handle the exception, this handler is not considered. —end example]
However, there is no calling function in the case where a function call appears in the initializer of a namespace-scope variable. Likewise, some constant expressions appearing in a type-id do not have calling functions, either. For example:
class C {
private:
constexpr int C(int) {}
friend void foo(int (*a)[1]) noexcept;
};
constexpr int bar(C) { return 1; }
void foo(int (&a)[bar(1)]) noexcept(bar(2) > 0); // presumably OK because of friendship
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-12-19 10:15:28 | admin | set | status: dr -> drwp |
2023-07-16 13:00:43 | admin | set | status: ready -> dr |
2023-04-28 19:41:23 | admin | set | messages: + msg7259 |
2023-04-28 19:41:23 | admin | set | status: open -> ready |
2023-04-02 00:00:00 | admin | create |