From db1b0f3e3c9647afb144ba2c0fbd186c72e12d14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Kami=C5=84ski?= Date: Thu, 6 Nov 2025 10:40:27 +0100 Subject: [PATCH 1/2] Updated PR for 4264 - correct example --- xml/issue4264.xml | 72 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 70 insertions(+), 2 deletions(-) diff --git a/xml/issue4264.xml b/xml/issue4264.xml index e30f7bdf53..3c4ee962e9 100644 --- a/xml/issue4264.xml +++ b/xml/issue4264.xml @@ -173,9 +173,8 @@ Set priority to 2 after reflector poll. Strong oposition to making it unspecified whether function_ref constructed from other function_ref will reference source object or its target directly.

- - +

This wording is relative to .

@@ -237,6 +236,75 @@ f2(); // it is unspecified if `f1` or `f2` is invoked +
+ +2025-11-06, Tomasz provides updated wording correcting example + + + + +

+This wording is relative to . +

+
    + +
  1. Modify as indicated:

    + +
    +

    +-2- Let t be an object of a type that is a specialization of function, +copyable_function, or move_only_function, or function_ref, +such that the target object x of t has a type that is a specialization of function, +copyable_function, ormove_only_function, or function_ref. +Each argument of the invocation of x evaluated as part of the invocation of t +may alias an argument in the same position in the invocation of t that has the same type, +even if the corresponding parameter is not of reference type. +

    +
    + +
  2. + +
  3. Modify as indicated:

    + +
    +
    +template<class F> constexpr function_ref(F&&) noexcept;
    +
    +
    +[…] +

    +-7- Effects: +Initializes bound-entity with addressof(f) +and thunk-ptr with the address of a function thunk such that +thunk(bound-entity, call-args...) is expression-equivalent +() to +invoke_r<R>(static_cast<cv T&>(f), call-args...). +

    +

    +-?- Remarks: +If remove_cvref_t<F> is a specialization of function_ref an implementation +may initialize bound-entity with bound-entity of f. +[Example: +

    +
    +void f1() noexcept;
    +void f2() noexcept;
    +
    +function_ref<void() noexcept> r1(&f1);
    +function_ref<void()> r2(r1);
    +r2(); // f1 is invoked
    +r1 = &f2;
    +r2(); // it is unspecified if f1 or f2 is invoked
    +
    +

    +end example] +

    +
    +
    + +
  4. +
+
From 720b94b637eebad245501072159c5de95c3bcd0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Kami=C5=84ski?= Date: Thu, 6 Nov 2025 11:04:53 +0100 Subject: [PATCH 2/2] Updated PR for 4308 - disable function types and array of unknown bound --- xml/issue4308.xml | 78 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 76 insertions(+), 2 deletions(-) diff --git a/xml/issue4308.xml b/xml/issue4308.xml index 0af088126b..928e9783a9 100644 --- a/xml/issue4308.xml +++ b/xml/issue4308.xml @@ -38,9 +38,8 @@ The aliases shouldn't be defined for non-object types, but probably harmless."

optional<T&> doesn't currently allow incomplete types anyway.

- - +

This wording is relative to .

@@ -79,7 +78,82 @@ type because it is not an actual iterator type. — end note] + +
+ +2025-11-06, Tomasz provides updated + + + + +
    + +
  1. Modify as indicated:

    +
    +
    +namespace std {
    +  template<class T>
    +  class optional<T&> {
    +  public:
    +    using value_type     = T;
    +    using iterator       = implementation-defined;  // present only if T is object type other than array of unknown bound; see [optional.ref.iterators]
    +  public:
    +    […]
    +
    +    // [optional.ref.iterators], iterator support
    +    constexpr iteratorauto begin() const noexcept;
    +    constexpr iteratorauto end() const noexcept;
    +
    +    […]
    +  };
    +}
    +
    +
    +
  2. +
  3. Modify as indicated:

    + +
    +
    +using iterator = implementation-defined; // present only if T is object type other than array of unknown bound
    +
    +
    +

    +-1- This type models `contiguous_iterator` (), meets the +Cpp17RandomAccessIterator requirements (), and meets +the requirements for constexpr iterators (), with value +type remove_cv_t<T>. The reference type is T& for `iterator`. +

    +

    +-2- All requirements on container iterators () apply to +`optional::iterator`. +

    +
    + +
    +constexpr iteratorauto begin() const noexcept;
    +
    +
    +

    -?- Constraints: T is an object type other than array of unknown bound.

    +

    +-3- Returns: An object `i` of `iterator` type, such thatIf `has_value()` is `true`, +`i` is an iterator referring to `*val` if `has_value()` is `true`, andOtherwise, +a past-the-end iterator value otherwise. +

    +
    + +
    +constexpr iteratorauto end() const noexcept;
    +
    +
    +

    -?- Constraints: T is an object type other than array of unknown bound.

    +

    -4- Returns: `begin() + has_value()`.

    +
    +
    + +
  4. +
+