From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C5ECA3858C60; Fri, 26 Apr 2024 20:14:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C5ECA3858C60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1714162440; bh=jrP2kMVU9N7b0ybgh2hRvqoW6Y0fXVl/SVGzxJaVlgw=; h=From:To:Subject:Date:From; b=HxaAd62MSAbk8hT5Wk/WZLuRzWEuxoP0pj0z7RG5g1Il7AdhPFxqL/iAcgOgmbLYN K8egVe10iiiiX/6on5av3SrW0lgHaoq2ai+uPNhn2rbRbcKw0CbO9iTmm2hjfRRBxy 7qAQtHKexZXtkqdrJl2+GWIlK/hpKuyZLOtOGkq8= From: "eggert at cs dot ucla.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/114869] New: GCC says nullptr_t is a C built in but it should be in Date: Fri, 26 Apr 2024 20:14:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: eggert at cs dot ucla.edu X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114869 Bug ID: 114869 Summary: GCC says nullptr_t is a C built in but it should be in Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eggert at cs dot ucla.edu Target Milestone: --- This is gcc (GCC) 14.0.1 20240411 (Red Hat 14.0.1-0) on x86-64. Compile the following one-line program with 'gcc -S t.c': nullptr_t x; GCC fails to issue a diagnostic that is required because nullptr_t is used without being defined. Conversely, compile the following program with 'gcc -std=3Dgnu23 -Wshadow -Wsystem-headers -S t.c': #include nullptr_t x; GCC issues the following incorrect diagnostic: In file included from t.c:1: /usr/lib/gcc/x86_64-redhat-linux/14/include/stddef.h:450:31: warning: declaration of =E2=80=98nullptr_t=E2=80=99 shadows a global declaration [-W= shadow] 450 | typedef __typeof__(nullptr) nullptr_t; | ^~~~~~~~~ cc1: note: shadowed declaration is here It seems that gcc defines nullptr_t as a built in identifier, which is incorrect; nullptr_t should be defined by just like ptrdiff_t is= .=