From owner-sc22wg14+sc22wg14-domo2=www.open-std.org@open-std.org  Thu Dec  3 04:05:14 2026
Return-Path: <owner-sc22wg14+sc22wg14-domo2=www.open-std.org@open-std.org>
X-Original-To: sc22wg14-domo2
Delivered-To: sc22wg14-domo2@www.open-std.org
Received: by www.open-std.org (Postfix, from userid 521)
	id 090B7356E89; Thu,  3 Dec 2026 04:05:14 +0100 (CET)
Delivered-To: sc22wg14@open-std.org
Received: from mail-oo1-f52.google.com (mail-oo1-f52.google.com [209.85.161.52])
	by www.open-std.org (Postfix) with ESMTP id 6CD23356D0D
	for <sc22wg14@open-std.org>; Thu,  3 Dec 2026 04:05:13 +0100 (CET)
Received: by mail-oo1-f52.google.com with SMTP id 006d021491bc7-71b7b706946so3968925eaf.3
        for <sc22wg14@open-std.org>; Wed, 02 Dec 2026 19:05:13 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1796267112; cv=none;
        d=google.com; s=arc-20260327;
        b=MRBFbudWd3OSsRQvy7Wc8n7YhteNO4F+w0nlO0jrLUF+1jzzrD3bYwdStFyzS/JzOG
         H31ieJ8AZDueH2yVDf08mKAS7T933TZoLrpK3ligXyJXls0o8e/vD4mpAhUIzRhH+Qfe
         L+uMzRQPomq2ddo/e/SHR285ePoDaSHAw2oWcOijm8gs84Zl4oc+vw0bDNDYhYLA7x+W
         39YXHs+IZo6wSnmjzMfK11uoD/5ZDvwHGlpf1EA/egP1EQFX3YYiyMcHUh5SzIxLW7Fh
         Q7mipjtltSMYuBLwN0EynXrEUB7b2zMjX26Y1MeZGCDZ5Qpkn7PHx41Kvr0qbLiBAg8N
         AxWQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=to:subject:message-id:date:from:mime-version:dkim-signature;
        bh=rhoRr3tn/Y7Y6YWZH6sMfdNw+zHWLwiCY+CBb9qDSUk=;
        fh=Aebk4qrc+hTUZ5/RnV3Y5eY8U2enESYnjZ5Tu3fILQs=;
        b=ICS3uQJgv5yZTCt8Mn+d2uI8D4UCVDo2lNjGocpPXaSnrpZCmp65OfPgAL/SaAKopx
         7YNVbixsHFoCjIHhQWUS4rTQb/IFFO/M3TcAzYnvatGy4gVY52afviQhBr+fB9milDvn
         y0GtgAnukxoKj5COYo+oxLR+5yCC2cwxcDq50s0WEX6DKOkLOTqMuqzX9oXEvkuzwQjA
         68H5FIcSJsY9o9uaLRjVdkgK4bXOYh5DwOtAGxP4p2OF6EJmpZgO6+N0xrC9jHj+VPKN
         kSX7nFBB1jGgHxMtTt3R8srddI9chz+YcNX9J5PVTfe9Q84M86UI2WNeOUxbuLMVQfQ/
         VbUw==;
        darn=open-std.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1796267112; x=1796871912; darn=open-std.org;
        h=content-type:to:subject:message-id:date:from:mime-version:from:to
         :cc:subject:date:message-id:reply-to:content-type;
        bh=rhoRr3tn/Y7Y6YWZH6sMfdNw+zHWLwiCY+CBb9qDSUk=;
        b=NJynC+V+J40mMZzLS2NzhTpE64LmTPBJEqOUVkuwafmYOrFJiAPC2LnG8F2KJLN6pQ
         tFQwzc1B/RUJjvdWOJr7nhzeuZWTJ1YE+sTDj2NRrROweuF5MUQZ9JEs5YHDX43Kuegu
         4L48qc68R6ARpziEwaLxCyUHuHB0mIvaCdtOZ5U49fQJkGBN7TrsvkTfA+hCptYg/lBU
         ZuxswJPyQMuUgtV+q8NJUoEZQuWslwCESoHzvufO6zoVD3KsIVtMcDrvWR+X6cAeLFgf
         fVZ44trUctWLE7rwrSZ7wzC9Zytq1OcXsE6eksRx3sa+UhsOnsbt9awOlluEZvBUno0g
         nqMw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1796267112; x=1796871912;
        h=content-type:to:subject:message-id:date:from:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=rhoRr3tn/Y7Y6YWZH6sMfdNw+zHWLwiCY+CBb9qDSUk=;
        b=vWx902fLU44cHI6Ft+hdTaPqA1bey8fSSDTyPS3QW+/+XKM16F2U8kcvIAOS/XBucv
         LEcwOzd3hivuedlt7+bes+PLQhSSdR9tDVPDhLBiiaZT25NSCNZh//8H7Hr2BbS3+c18
         Ae+na2+8dFSb1muOPS12XGZLeJujevFkkvIC9t1JA7KNRcfwwwhYNRAwn6jqMXqqSQgt
         nEGo4zStQfNjs6PB3uH9pexPJ2rzg8LCW8bRBLW6iUlaAMIvuimh2djewSgeY58g459b
         ey+7fPfaVTRUwZIGFji5M3jYeOAncyb8lemP9NWmOMDJQ27JaUlhRujLc2piP1P4Qdwr
         PEZA==
X-Gm-Message-State: APuU4Z+ifJ2lCQk4xsMNTgpmJT6iEapgiOFBTiXG0/G498oW4IPQOAuD
	ltwepZiyCVzFXmg8D7aRAEC2OChdJlq0TD5Pzpg1jmUhca5tF4U4zAOBQ7A248yZRCHIlRLE43H
	MDU76IpuIBxTWTvVjQb6JqULog9vHVIpjE+tfOYM=
X-Gm-Gg: AZFdTZeKijN0DmuYHlkzOa2VdbRK91ySAAK6iNX7o03oFQF4u4fgV3xMxYMvY0RsRdl
	nlsPePfqCC6mr4k5hLll3mPiCN8VDUnX4ue6wVh6OGd7H7OllI31JQMseIo/o8Off2CwbRcEjI9
	kBmumEL+l/w/POACqRFa8F8ANECtHv0uTMCj97MOaxL+G0jOmzd/NCZiDcp3hnp2icJnUr0F0sO
	Atu4UeWk9B9H2t1nrkrBvvFFhMLxaUioP1omLaLqDV0Eo2vAlS2hE+L2blbgjyYHbFKf+V+gecI
	Y3sQJCzthPLPBLl4yoJhClS2Fq7h16Qnx/VHQUkVoyrUaNzAm5VeqHuoK/moEzai0McqMVigUn7
	MFxGKEPWBlSm5WowrR1PBqeznsBmAoOpg6rThe4ydta/cF6yKbCUdTOqVnJoLxbR1Cycm2+RRgh
	ZVH0unpd194EjTJ3AIhJ2Ppi3NVKl7dkAe+BGzl5C6Tze5uUrb/Qo3KlnScyWkqwMGF8OB4DENk
	BAFBBG6yfbkIOcr
X-Received: by 2002:a05:6820:809:b0:71b:7d6f:d400 with SMTP id
 006d021491bc7-71bc2401278mr8861834eaf.22.1796267112134; Wed, 02 Dec 2026
 19:05:12 -0800 (PST)
MIME-Version: 1.0
From: JeanHeyd Meneide <phdofthehouse@gmail.com>
Date: Wed, 2 Dec 2026 22:04:59 -0500
X-Gm-Features: Aa3M54qRzO_dfn1Yb9qXL3xqTxQjAFagFGfXbRTzjY4QKYMKL_q54MtiIGVxWYE
Message-ID: <CANHA4Oi-LSmfOVXyXMV6HD4OXZ=zWakuz9A-zv1ZgyBC32AW+A@mail.gmail.com>
Subject: Wording for issue 1031 (Generic selection & value conversions)
To: wg14 <sc22wg14@open-std.org>, Joseph Myers <josmyers@redhat.com>
Content-Type: multipart/alternative; boundary="00000000000023fd040661b207e2"
Sender: owner-sc22wg14@open-std.org
Precedence: bulk

--00000000000023fd040661b207e2
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Issue 1031 talks about incomplete types in _Generic selection. The gist of
the issue is that due to using the wording " as if it had undergone an
lvalue conversion ...", the submitter asserts that this could reasonably be
read to trigger UB (or, in C2y, a constraint violation since it was turned
into one).

The intent of the wording in C23 and prior was always that the type was
being converted, not the value, and the value remained largely unevaluated
on purpose (even in with many VLA-typed values). Therefore, to clarify the
wording, it should be changed. For C23, we can change  6.3.3.1 "Lvalues,
arrays, and function designators", paragraph 2 to have the following extra
definition:

Except when it is the operand of the sizeof operator, or the typeof
operators, the unary & operator, the ++ operator, the -- operator, or the
left operand of the . operator or an assignment operator, an lvalue that
does not have array type is converted to the value stored in the designated
object (and is no longer an lvalue); this is called <i>lvalue
conversion</i>. <ins>A <i>type lvalue conversion</i> is the transformation
of a type to what it would be after an lvalue conversion has taken place if
possible, or the original type if an lvalue conversion is not
possible.</ins>

Then, in C23's 6.5.2.1 "Generic selection", paragraph 2, we change the text
as follows:
The type of the controlling expression is the type of the expression as if
it had undergone an <ins>type</ins> lvalue conversion, array to pointer
conversion, or function to pointer conversion.

This should make it abundantly clear that no evaluation is taking place,
and therefore no constraint is being violated.

In C2y, current working draft, the change should look something like
follows, staring with C2y 6.3.3.1 "Lvalues, arrays, and function
designators", start of paragraph 2:

Except when it is the operand of:

=E2=80=94 the sizeof operator,
=E2=80=94 the typeof operators,
=E2=80=94 the unary & operator,
=E2=80=94 the ++ operator,
=E2=80=94 the -- operator,
=E2=80=94 the left operand of the . operator,
=E2=80=94 or, an assignment operator

an lvalue that does not have array type is converted to the value stored in
the designated object (and is no longer an lvalue); this is called
<ins>lvalue conversion</ins>.  <ins>A <i>type lvalue conversion</i> is the
transformation of a type to what it would be after an lvalue conversion has
taken place if possible, or the original type if an lvalue conversion is
not possible.</ins>

Then, in the current C2y 6.5.2.1 "Generic selection", second sentence of
paragraph 2:

If the generic controlling operand is an assignment expression, the
<i>controlling
type</i> of the generic selection expression is the type of the assignment
expression as if it had undergone <del>an</del><ins>a type</ins> lvalue
conversion, array to pointer conversion, or function to pointer conversion.


This should solve the problem, since there is an explicit and unambiguous
fallback for "just the type itself if an lvalue conversion is not
possible".

Sincerely,
JeanHeyd

--00000000000023fd040661b207e2
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Issue 1031 talks about incomplete types in _Generic s=
election. The gist of the issue is that due to using the wording &quot;
as if it had undergone an lvalue conversion ...&quot;, the submitter assert=
s that this could reasonably be read to trigger UB (or, in C2y, a constrain=
t violation since it was turned into one).<br><br></div><div>The intent of =
the wording in C23 and prior was always that the type was being converted, =
not the value, and the value remained largely unevaluated on purpose (even =
in with many VLA-typed values). Therefore, to clarify the wording, it shoul=
d be changed. For C23, we can change=C2=A0 6.3.3.1 &quot;Lvalues, arrays, a=
nd function designators&quot;, paragraph 2 to have the following extra defi=
nition:</div><div><blockquote>
Except when it is the operand of the <code>sizeof</code> operator, or the
typeof operators, the unary <code>&amp;</code> operator, the <code>++</code=
> operator, the
<code>--</code> operator, or the left operand of the <code>.</code> operato=
r or an
assignment operator, an lvalue that does not have array type is
converted to the value stored in the designated object (and is no
longer an lvalue); this is called &lt;i&gt;lvalue conversion&lt;/i&gt;. &lt=
;ins&gt;A &lt;i&gt;type lvalue conversion&lt;/i&gt; is the transformation o=
f a type to what it would be after an lvalue conversion has taken place if =
possible, or the original type if an lvalue conversion is not possible.&lt;=
/ins&gt;</blockquote><p>Then, in C23&#39;s 6.5.2.1 &quot;Generic selection&=
quot;, paragraph 2, we change the text as follows:</p><div style=3D"margin-=
left:40px">
The type of the controlling expression is the type of the expression
as if it had undergone an &lt;ins&gt;type&lt;/ins&gt;=C2=A0lvalue conversio=
n, array to pointer
conversion, or function to pointer conversion.</div><br></div><div>This sho=
uld make it abundantly clear that no evaluation is taking place, and theref=
ore no constraint is being violated.</div><div><br></div><div>In C2y, curre=
nt working draft, the change should look something like follows, staring wi=
th C2y=C2=A06.3.3.1 &quot;Lvalues, arrays, and function designators&quot;, =
start of paragraph 2:</div><div><br></div><div style=3D"margin-left:40px">E=
xcept when it is the operand of:</div><div style=3D"margin-left:40px"><br><=
/div><div style=3D"margin-left:40px"><div style=3D"margin-left:40px">=E2=80=
=94 the sizeof operator,<br>=E2=80=94 the typeof operators,<br>=E2=80=94 th=
e unary &amp; operator,<br>=E2=80=94 the ++ operator,<br>=E2=80=94 the -- o=
perator,<br>=E2=80=94 the left operand of the . operator,<br>=E2=80=94 or, =
an assignment operator</div><div style=3D"margin-left:40px"><br></div></div=
><div style=3D"margin-left:40px">an lvalue that does not have array type is=
 converted to the value stored in the designated object (and is no longer a=
n lvalue); this is called &lt;ins&gt;lvalue conversion&lt;/ins&gt;.=C2=A0
&lt;ins&gt;A &lt;i&gt;type lvalue conversion&lt;/i&gt; is the transformatio=
n of a type to what it would be after an lvalue conversion has taken place =
if possible, or the original type if an lvalue conversion is not possible.&=
lt;/ins&gt;

</div><div><br></div><div>Then, in the current C2y 6.5.2.1 &quot;Generic se=
lection&quot;, second sentence of paragraph 2:</div><div><br></div><div sty=
le=3D"margin-left:40px">If the generic controlling operand is an assignment=
 expression, the<i> </i>&lt;i&gt;controlling type&lt;/i&gt; of the generic =
selection expression is the type of the assignment expression as if it had =
undergone &lt;del&gt;an&lt;/del&gt;&lt;ins&gt;a type&lt;/ins&gt;=C2=A0lvalu=
e conversion, array to pointer conversion, or function to pointer conversio=
n. </div><div><br></div><div><br></div><div>This should solve the problem, =
since there is an explicit and unambiguous fallback for &quot;just the type=
 itself if an lvalue conversion is not possible&quot;.=C2=A0</div><div><br>=
</div><div>Sincerely,</div><div>JeanHeyd</div><div><br></div></div>

--00000000000023fd040661b207e2--
