From owner-freebsd-ports@freebsd.org Thu May 12 11:33:43 2016 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 197B2B38787 for ; Thu, 12 May 2016 11:33:43 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 090131A22 for ; Thu, 12 May 2016 11:33:43 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: by mailman.ysv.freebsd.org (Postfix) id 04AEAB38786; Thu, 12 May 2016 11:33:43 +0000 (UTC) Delivered-To: ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04502B38785 for ; Thu, 12 May 2016 11:33:43 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell1.rawbw.com (shell1.rawbw.com [198.144.192.42]) by mx1.freebsd.org (Postfix) with ESMTP id EB0161A21 for ; Thu, 12 May 2016 11:33:42 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from yuri.doctorlan.com (c-24-5-143-190.hsd1.ca.comcast.net [24.5.143.190]) (authenticated bits=0) by shell1.rawbw.com (8.15.1/8.15.1) with ESMTPSA id u4CBXfO2026438 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Thu, 12 May 2016 04:33:41 -0700 (PDT) (envelope-from yuri@rawbw.com) X-Authentication-Warning: shell1.rawbw.com: Host c-24-5-143-190.hsd1.ca.comcast.net [24.5.143.190] claimed to be yuri.doctorlan.com To: "ports@freebsd.org" From: Yuri Subject: Why clang++37 behaves differently on 9.3 and 10.3? Message-ID: <57346A14.6010402@rawbw.com> Date: Thu, 12 May 2016 04:33:40 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2016 11:33:43 -0000 clang++37 compiles this simple program fine on 10.3, but fails on 9.3. Why does it behave differently on different OS versions? It looks like it ignores -std=c++11 on 9.3. Yuri ---program--- #include int main() { const int vmax = std::numeric_limits::max(); static_assert(vmax>0, ""); } ---command--- clang++37 -std=c++11 -c test.cc ---error on 9.3--- test.cc:6:17: error: static_assert expression is not an integral constant expression static_assert(vmax>0, ""); ^~~~~~ test.cc:6:17: note: initializer of 'vmax' is not a constant expression test.cc:5:13: note: declared here const int vmax = std::numeric_limits::max(); ^ 1 error generated.