From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EAB9C3858291; Tue, 28 Feb 2023 12:48:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EAB9C3858291 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677588527; bh=l9ZOPw2aWSc8VqQe+t2jGyo3X576UpHUke4p0Tm/nB8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=S3pMXx16ZDArOO/RHvgJtVf3L8ELPuYxu+8xWx3oZSIkZ9xaZ+PEePmBzEdzY2CwH v52Iq9oZrYTtsr/AD3HosYbZEq/lxoIKlF69MFs/2PlKPt7QBZTD5UIxjnpvsCdbx0 99ZcQchOcVOeGS0IOc3A3Esqp9cBki9Auh8eHpLI= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108965] g++: unable to parse c11 _Generics Date: Tue, 28 Feb 2023 12:48:47 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.3.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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=3D108965 --- Comment #9 from Jonathan Wakely --- (In reply to Christopher Friedt from comment #8) > My code is clearly valid C++ according to g++ :-) Maybe you mean clang++ but even then, no it's not: $ clang++ -pedantic gen.cc gen.cc:15:32: warning: '_Generic' is a C11 extension [-Wc11-extensions] printf("cbrt(8.0) =3D %f\n", cbrt(x)); // selects the default cbrt ^ gen.cc:5:17: note: expanded from macro 'cbrt' #define cbrt(X) _Generic((X), \ ^ gen.cc:16:35: warning: '_Generic' is a C11 extension [-Wc11-extensions] printf("cbrtf(3.375) =3D %f\n", cbrt(y)); // converts const float to fl= oat, ^ gen.cc:5:17: note: expanded from macro 'cbrt' #define cbrt(X) _Generic((X), \ ^ 2 warnings generated. It's a non-standard extension, not valid C++.=