From owner-freebsd-standards@FreeBSD.ORG Mon Jul 29 11:27:38 2013 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7E00EFA6; Mon, 29 Jul 2013 11:27:38 +0000 (UTC) (envelope-from kubito@gmail.com) Received: from mail-oa0-x231.google.com (mail-oa0-x231.google.com [IPv6:2607:f8b0:4003:c02::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 07B622054; Mon, 29 Jul 2013 11:27:37 +0000 (UTC) Received: by mail-oa0-f49.google.com with SMTP id n16so1286857oag.22 for ; Mon, 29 Jul 2013 04:27:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=Y8Nt738cak9jGA8Oj3TVrQEv6NEdC7+Rb2HlHDlDuvc=; b=OM9355H/eZQQRU0N5v5VmoRrK8EjVCOYgXjID1p2wrEFZfQEcFmMS6EneGtF9zIoHm JDUadzGrbwAoagkpjTA1OnM5E4gh3P3kI8yLcX4FTu9LLRIzktCzX1yOEING7QlCpHFz cZTTbXXrJWlg6nufRW1K/vCtAUQUyyS945OHL5OxTrQVp9xgViWZaMidnIH0i/xSDKwR YscXivvqJaWY9gIRDm5lX47SoERwbG/A+H0jPET7pBRbp1cvxlkY8vdBbliJCRUbAM94 LrgMICQBS45dY2JLIqP25ZgzOWa02Ln4CarxrAzFeQlpaRdBlohlRrr8+gC4cSoX0SdJ yVZA== X-Received: by 10.60.34.130 with SMTP id z2mr15075527oei.87.1375097257406; Mon, 29 Jul 2013 04:27:37 -0700 (PDT) Received: from rachacuca.gmail.com (li113-135.members.linode.com. [69.164.198.135]) by mx.google.com with ESMTPSA id jz7sm86843109obb.4.2013.07.29.04.27.36 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 29 Jul 2013 04:27:36 -0700 (PDT) Sender: Raphael Kubo da Costa From: Raphael Kubo da Costa To: David Chisnall Subject: Re: CURRENT: CLANG 3.3 and -stad=c++11 and -stdlib=libc++: isnan()/isninf() oddity References: <20130710155809.0f589c22@thor.walstatt.dyndns.org> <20130710183315.725dfde0@thor.walstatt.dyndns.org> <20130710203200.5359fd18@thor.walstatt.dyndns.org> <51DDC04B.6040209@FreeBSD.org> <20957.49978.73666.392417@khavrinen.csail.mit.edu> <20130711130043.R920@besplex.bde.org> <20130711202908.L84170@besplex.bde.org> <20130712234749.5afa3c9b@thor.walstatt.dyndns.org> <9B0A6D14-640E-4ADD-8E58-0B7867C7C674@FreeBSD.org> <51E145CC.8080900@iki.fi> <861u6iv0ih.fsf@orwell.Elisa> Date: Mon, 29 Jul 2013 08:27:29 -0300 In-Reply-To: (David Chisnall's message of "Mon, 29 Jul 2013 09:19:40 +0100") Message-ID: <83zjt5mwri.fsf@FreeBSD.org> User-Agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Cc: Scot Hetzel , Pasi Parviainen , "freebsd-standards@FreeBSD.org" , "freebsd-toolchain@FreeBSD.org" , Garrett Wollman , FreeBSD Current , Tijl Coosemans , "O. Hartmann" X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 11:27:38 -0000 David Chisnall writes: > On 28 Jul 2013, at 22:27, Raphael Kubo da Costa wrote: > >> This seems to have been committed in r253321, and broke some code that >> was working with r253320; namely, some code in x11/kde4-workspace >> includes math.h and calls isnan() with a const double. > > Please provide a test case. Specifically, I need to know what > language dialect this is using, because I have tested including math.h > and calling isnan(double) with c89, gnu89, c99, c11, c++03 and c++11 > on gcc (for the modes that it supports) and clang. I get the following results with and without -std=c++11 and/or -stdlib=libc++: % cat isnan.cc #include int main() { const double d = 42.0; return isnan(d) ? 1 : 0; } % clang++ isnan.cc isnan.cc:4:10: error: controlling expression type 'const double' not compatible with any generic association type return isnan(d) ? 1 : 0; ^~~~~~~~ /usr/include/math.h:109:2: note: expanded from macro 'isnan' __fp_type_select(x, __inline_isnanf, __inline_isnan, __inline_isnanl) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/math.h:86:49: note: expanded from macro '__fp_type_select' #define __fp_type_select(x, f, d, ld) _Generic((0,(x)), \ ^~~~~ 1 error generated.