This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.

4414. §[simd.expos.abi] deduce-abi-t is underspecified and incorrectly referenced from rebind and resize

Section: 29.10.2.2 [simd.expos.abi], 29.10.4 [simd.traits] Status: New Submitter: Matthias Kretz Opened: 2025-10-15 Last modified: 2025-10-25

Priority: Not Prioritized

View all issues with New status.

Discussion:

In 29.10.2.2 [simd.expos.abi], deduce-abi-t is specified to be defined for some arguments. For all remaining arguments, nothing is specified. This could be interpreted to make such specializations ill-formed. But that does not match the intent of making

simd::vec<std::string>

and

simd::vec<int, INT_MAX>

disabled specializations of basic_vec. (If INT_MAX is not supported by the implementation.)

The wording needs to clarify what happens in those cases.

In 29.10.4 [simd.traits], rebind and resize say "deduce-abi-t<T, V::size()> has a member type type". But that's not how deduce-abi-t is specified.

Previous resolution [SUPERSEDED]:

This wording is relative to N5014.

  1. Modify 29.10.4 [simd.traits] as indicated:

    template<class T, class V> struct rebind { using type = see below; };
    

    -4- The member type is present if and only if

    1. (4.1) — V is a data-parallel type,

    2. (4.2) — T is a vectorizable type, and

    3. (4.3) — deduce-abi-t<T, V::size()> has a member type type is defined.

    […]
    template<simd-size-type N, class V> struct resize { using type = see below; };
    

    -7- Let T denote […]

    -8- The member type is present if and only if

    1. (8.1) — V is a data-parallel type, and

    2. (8.2) — deduce-abi-t<T, N> has a member type type is defined.

[2025-10-21; Matthias Kretz improves discussion and proposed wording]

Proposed resolution:

This wording is relative to N5014.

  1. Modify 29.10.2.2 [simd.expos.abi] as indicated:

    template<class T> using native-abi = see below;
    template<class T, simd-size-type N> using deduce-abi-t = see below;
    

    -1- An ABI tag is a type that indicates a choice of size and binary representation for objects of data-parallel type.

    […]

    -3- An implementation defines ABI tag types as necessary for the following aliases.

    -4- deduce-abi-t<T, N> is definednames an ABI tag type if and only if

    1. (4.1) — T is a vectorizable type,

    2. (4.2) — N is greater than zero, and

    3. (4.3) — N is not larger than an implementation-defined maximum.

    Otherwise, deduce-abi-t<T, N> names an unspecified type.

    The implementation-defined maximum for N is not smaller than 64 and can differ depending on T. […]

    -5- Where present,If deduce-abi-t<T, N> names an ABI tag type such that, the following is true:

    1. (5.1) — simd-size-v<T, deduce-abi-t<T, N>> equals N,

    2. (5.2) — basic_vec<T, deduce-abi-t<T, N>> is enabled (29.10.7.1 [simd.overview]), and

    3. (5.3) — basic_mask<sizeof(T), deduce-abi-t<integer-from<sizeof(T)>, N>> is enabled.

  2. Modify 29.10.4 [simd.traits] as indicated:

    template<class T, class V> struct rebind { using type = see below; };
    

    -4- The member type is present if and only if

    1. (4.1) — V is a data-parallel type,

    2. (4.2) — T is a vectorizable type, and

    3. (4.3) — deduce-abi-t<T, V::size()> has a member type type names an ABI tag type.

    […]
    template<simd-size-type N, class V> struct resize { using type = see below; };
    

    -7- Let T denote […]

    -8- The member type is present if and only if

    1. (8.1) — V is a data-parallel type, and

    2. (8.2) — deduce-abi-t<T, N> has a member type type names an ABI tag type.