Quantcast

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

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

MacPorts
#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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

MacPorts
#53634: clang++-mp-4.0 -stdlib=macports-libstdc++ should be in C++11 mode by
default
------------------------+----------------------
  Reporter:  mojca      |      Owner:  mojca
      Type:  defect     |     Status:  assigned
  Priority:  Low        |  Milestone:
 Component:  ports      |    Version:
Resolution:             |   Keywords:
      Port:  clang-4.0  |
------------------------+----------------------
Changes (by jeremyhu):

 * owner:  jeremyhu => mojca
 * status:  new => assigned


Comment:

 I'm certainly fine letting -stdlib=macports-libstdc++ imply -std=c++11.
 Feel free to make that change.  Of course, -stdlib=libstdc++ should not
 change.

--
Ticket URL: <https://trac.macports.org/ticket/53634#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

MacPorts
In reply to this post by MacPorts
#53634: clang++-mp-4.0 -stdlib=macports-libstdc++ should be in C++11 mode by
default
------------------------+----------------------
  Reporter:  mojca      |      Owner:  mojca
      Type:  defect     |     Status:  assigned
  Priority:  Low        |  Milestone:
 Component:  ports      |    Version:
Resolution:             |   Keywords:
      Port:  clang-4.0  |
------------------------+----------------------

Comment (by mojca):

 Marcus, since you were patching this, do you have any idea where/how to
 fix the behaviour? I'm not too familiar with llvm sources. I did some
 grep-ing for various variables, I found places like `Opts.CPlusPlus11 =
 Std.isCPlusPlus11()`, but it's so much code that it's nearly impossible to
 know where the decision is made about whether or not C++11 should be the
 default.

--
Ticket URL: <https://trac.macports.org/ticket/53634#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

MacPorts
In reply to this post by MacPorts
#53634: clang++-mp-4.0 -stdlib=macports-libstdc++ should be in C++11 mode by
default
------------------------+----------------------
  Reporter:  mojca      |      Owner:  mojca
      Type:  defect     |     Status:  assigned
  Priority:  Low        |  Milestone:
 Component:  ports      |    Version:
Resolution:             |   Keywords:
      Port:  clang-4.0  |
------------------------+----------------------
Changes (by mojca):

 * cc: kencu (added)


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