<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello,<div><br></div><div>After the commit r127596, it's not longer possible to use the gcc 4.2.1 libstdc++ while compiling c++0x code.</div><div><br></div><div>For instance, just including <span class="Apple-style-span" style="color: rgb(123, 72, 47); font-family: Menlo; font-size: 11px; "><span style="color: #d92823"><vector></span><font class="Apple-style-span" color="#000000" face="Helvetica" size="3"><span class="Apple-style-span" style="background-color: transparent; font-size: 12px;"> in a file make clang emit the following diagnostics.</span></font></span></div><div><br></div><div><br></div><div>--- test.cpp</div><div><br></div><div>#include <span class="Apple-style-span" style="color: rgb(217, 40, 35); font-family: Menlo; font-size: 11px; "><vector></span></div><div><span class="Apple-style-span" style="color: rgb(217, 40, 35); font-family: Menlo; font-size: 11px; "><br></span></div><div><span class="Apple-style-span" style="background-color: transparent;">---------</span></div><div><span class="Apple-style-span" style="background-color: transparent;"><br></span></div><div><span class="Apple-style-span" style="color: rgb(123, 72, 47); font-family: Menlo; "><font class="Apple-style-span" color="#000000" face="Helvetica"><span class="Apple-style-span" style="background-color: transparent; "></span></font></span><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">% clang++ -std=c++0x -fsyntax-only test.cpp</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">In file included from test.cpp:2:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">In file included from /usr/include/c++/4.2.1/vector:66:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">In file included from /usr/include/c++/4.2.1/bits/allocator.h:53:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">In file included from /usr/include/c++/4.2.1/i686-apple-darwin10/x86_64/bits/c++allocator.h:39:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">In file included from /usr/include/c++/4.2.1/ext/new_allocator.h:37:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">/usr/include/c++/4.2.1/new:95:7: error: exception specification in declaration does not match previous declaration</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">void* operator new(std::size_t) throw (std::bad_alloc);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">      ^</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">note: previous declaration is here</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">/usr/include/c++/4.2.1/new:96:7: error: exception specification in declaration does not match previous declaration</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">void* operator new[](std::size_t) throw (std::bad_alloc);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">      ^</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">note: previous declaration is here</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">2 errors generated.</div><div><br></div><div>I suppose this is a problem with libstdc++ 4.2.1 which is not standard compliant, but as it is widely used on OS X, maybe clang should do something to workaround the problem.</div><div><br></div><div><br></div><div><div>
<div>-- Jean-Daniel</div><div><br></div><div><br></div><br class="Apple-interchange-newline">
</div>
<br></div></div></body></html>