Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 May 2016 04:33:40 -0700
From:      Yuri <yuri@rawbw.com>
To:        "ports@freebsd.org" <ports@freebsd.org>
Subject:   Why clang++37 behaves differently on 9.3 and 10.3?
Message-ID:  <57346A14.6010402@rawbw.com>

next in thread | raw e-mail | index | archive | help
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 <limits>

int main() {
   const int vmax = std::numeric_limits<int>::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<int>::max();
             ^
1 error generated.






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?57346A14.6010402>