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.



_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[email protected]"

Reply via email to