[MacPorts] #53634: clang++-mp-4.0 -stdlib=macports-libstdc++ should be in C++11 mode by default

MacPorts noreply at macports.org
Thu Feb 23 15:24:09 UTC 2017


#53634: clang++-mp-4.0 -stdlib=macports-libstdc++ should be in C++11 mode by
default
--------------------+-----------------------
 Reporter:  mojca   |      Owner:  jeremyhu
     Type:  defect  |     Status:  new
 Priority:  Low     |  Milestone:
Component:  ports   |    Version:
 Keywords:          |       Port:  clang-4.0
--------------------+-----------------------
 Related to #53194, #53329, #53330.

 Compare the following output on < 10.9:
 {{{
 > g++-mp-6 test.cpp -o test
 # OK
 }}}
 {{{
 > clang++-mp-4.0 -stdlib=libc++ test.cpp -o test
 # OK
 }}}
 {{{
 > clang++-mp-4.0 test.cpp -o test
 test.cpp:1:10: fatal error: 'regex' file not found
 #include <regex>
          ^~~~~~~
 1 error generated.
 }}}
 {{{
 > clang++-mp-4.0 -stdlib=macports-libstdc++ test.cpp -o test
 In file included from test.cpp:1:
 In file included from /opt/local/include/gcc6/c++/regex:35:
 /opt/local/include/gcc6/c++/bits/c++0x_warning.h:32:2: error: This file
 requires compiler and library support for the ISO C++ 2011 standard. This
 support must be
       enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support \
  ^
 1 error generated.
 }}}
 The file `test.cpp` is a simple `#include <regex> int main() { return 0;
 }`

 While this can be avoided by adding a `-std=c++11` flag, the behaviour
 would be much more consistent if the compiler would assume C++11 by
 default.

 See also #53625 where this first came up.

--
Ticket URL: <https://trac.macports.org/ticket/53634>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list