From owner-sc22wg14+sc22wg14-domo2=www.open-std.org@open-std.org  Tue Oct  7 22:07:48 2025
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 01FA1356C67; Tue,  7 Oct 2025 22:07:47 +0200 (CEST)
Delivered-To: sc22wg14@open-std.org
Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124])
	by www.open-std.org (Postfix) with ESMTP id 75A95356A2B
	for <sc22wg14@open-std.org>; Tue,  7 Oct 2025 22:07:46 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1759867663;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:mime-version:mime-version:content-type:content-type;
	bh=c9vnOP3D6FIB4Q7yvZUP7GPh6l3yAETGFfiIpyFhwN8=;
	b=M8F8ulT7cMLg/q0Bg0BmDvZziX/CWddXgGqI/9eLDFRf3DiG4fdnRrxDt2rpUEmTxUr4P8
	t3ODsw/Ox3GI55bFPAWLSfladsTlG9pavYW+268LzbMDo39/k+PNJu7T39dWVOszsK3sTg
	ESJULb/3+W3UuM2VuEpdVUH9QfVDcn8=
Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com
 [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id
 us-mta-338-wUSjSnBQP4GxThzP7FIEaQ-1; Tue, 07 Oct 2025 16:07:42 -0400
X-MC-Unique: wUSjSnBQP4GxThzP7FIEaQ-1
X-Mimecast-MFC-AGG-ID: wUSjSnBQP4GxThzP7FIEaQ_1759867661
Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-3f7b5c27d41so118871f8f.0
        for <sc22wg14@open-std.org>; Tue, 07 Oct 2025 13:07:41 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1759867660; x=1760472460;
        h=mime-version:message-id:subject:to:from:date:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=c9vnOP3D6FIB4Q7yvZUP7GPh6l3yAETGFfiIpyFhwN8=;
        b=BvOPmuu1eKY+O8koN2ufTO/LIndJbfeGMz/jT/95Ffrnj2zP+4FlPNDtt32VE9tBmw
         0+1FUxGEkYvCwVvP+UpykOVb2muLYE3mX3YuB8TKPvuYu3HzEFgdZOqp9NlRT2XKpHVL
         0MSkpW8i9oftKL+JdIhOuG52S7nyL23blcuwI0heOTNB2g5lJ4zxXv87ImhAcnrlkJEh
         BrIIb/bJUncVLvnduehbwLpG5gN0T2YR3dResFD7j+NUDTt8sSpbwpKUUy99ybJAzzMK
         5WY3DoaqmPnMfZFh3Srg8LBJwL50NQY8UGjnirk8yI01/D1XHJ9Ul8TTrAuJxH8//q0t
         ovUg==
X-Gm-Message-State: AOJu0Yzyq1cjK4sGSDzCuJ6LZIerwjQfF9NYF8L47BgYIGP6siujtfDJ
	IO1w6z0iaoeKTntCeqQ3aPzaMIR/8HbiC51M48pKli5kBR1VbXGpks/S2QL0sLP94rUuuHrMUpx
	hNZ84BUQ3PNZQXr4Mnn2b4aEcvEc5Sv9NZOX1J6ghu1wCBXhjfsPk9xOjtG+g01SrryoCp27QKG
	YKH/YJMqqkJzE0aYFVPhOHpUPBmeaP206o2sPjBDXv
X-Gm-Gg: ASbGncurHf4NL/10JeXnUQ9axtrLIFgaJ+56C0TiaX4VsxNvhXs6reu5LX+MbOMSSB5
	y7yfGFwMb4U4+GtmX7sOm7akQbMsXex4JjQRcNm1op4bC0YrPAyoyFwdFUQEe0D1NEZ7uQC3Ryq
	wGOeOo3CI54P0tCzSzGiNdaN4tVq68SEiR2NmOdyJnhEvsPXM1G6a3wXEy/vfxyyaytRZvQ04fj
	+6oZ6RZsoxN0SgpUaDyNOtwndbq2prWZcbDqhventVuNMLNhP4j3KO8bhIoPMeW+XLXaJQg2IW6
	fgUjYnixQm0UkEzarEYuDxyjDTm8ggpxtpSO+EXjJko74ESAtanMPEYU4ZGLLV8G1w293VlxL+d
	s
X-Received: by 2002:a05:6000:24c4:b0:3f4:ad3f:7c35 with SMTP id ffacd0b85a97d-42582a0534bmr2936268f8f.27.1759867660426;
        Tue, 07 Oct 2025 13:07:40 -0700 (PDT)
X-Google-Smtp-Source: AGHT+IEZNC1m5BKPocSQI3zfXcoaQd/pXt5YxKk2VnQdXcVkjmTqN0uXCYGRqlx0ya1HIcfmpVWpPg==
X-Received: by 2002:a05:6000:24c4:b0:3f4:ad3f:7c35 with SMTP id ffacd0b85a97d-42582a0534bmr2936252f8f.27.1759867659881;
        Tue, 07 Oct 2025 13:07:39 -0700 (PDT)
Received: from digraph.polyomino.org.uk (digraph.polyomino.org.uk. [2001:8b0:bf73:93f7::51bb:e332])
        by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46fa2cfa2dcsm23750095e9.0.2025.10.07.13.07.39
        for <sc22wg14@open-std.org>
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Tue, 07 Oct 2025 13:07:39 -0700 (PDT)
Received: from jsm28 (helo=localhost)
	by digraph.polyomino.org.uk with local-esmtp (Exim 4.97)
	(envelope-from <josmyers@redhat.com>)
	id 1v6DyD-00000000vvt-2VhL
	for sc22wg14@open-std.org;
	Tue, 07 Oct 2025 20:07:37 +0000
Date: Tue, 7 Oct 2025 20:07:37 +0000 (UTC)
From: Joseph Myers <josmyers@redhat.com>
To: sc22wg14@open-std.org
Subject: Incomplete internal linkage tentative definitions completed in inner
 scope
Message-ID: <d460d832-fbce-5b74-c77c-aa53e9379272@redhat.com>
MIME-Version: 1.0
X-Mimecast-Spam-Score: 0
X-Mimecast-MFC-PROC-ID: VGaPnr2B4IR4FKaqTJW5KkwRkVMT6nf2A_gRn9AVevE_1759867661
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset=US-ASCII
Sender: owner-sc22wg14@open-std.org
Precedence: bulk

For C2y we decided to allow tentative definitions with internal linkage 
and incomplete type, following N3347 (accepted with a delay in Minneapolis 
subject to lack of objections by the end of the Graz meeting).  That was 
accepted with wording for a new constraint taken from reflector message 
26758: "If the declaration of an identifier for an object is a tentative 
definition with incomplete type and internal linkage, the type of the 
object shall be completed before the end of the translation unit.".

That wording clearly improved on the originally proposed wording in the 
case where a second declaration completes the incomplete array type of the 
first declaration, but still leaves an ambiguity.  Suppose the type is 
completed in an inner scope:

  static int a[];
  void f() { extern int a[1]; }

Is this valid, because the type gets completed in an inner scope before 
the end of the translation unit, or invalid, because the type at the end 
of the translation unit is incomplete even though the type inside f at the 
end of that function is complete?

-- 
Joseph S. Myers
josmyers@redhat.com

