<font size="2"><font face="tahoma,sans-serif">This is a recent regression, see <a href="http://llvm.org/bugs/show_bug.cgi?id=9804">http://llvm.org/bugs/show_bug.cgi?id=9804</a><br><br>ismail<br></font></font><br><div class="gmail_quote">

On Thu, Apr 28, 2011 at 2:43 PM, Vassil Vassilev <span dir="ltr"><<a href="mailto:vasil.georgiev.vasilev@cern.ch">vasil.georgiev.vasilev@cern.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hi,<br>
   Interesting... I don't think it is only for 0x... I have the same<br>
problem:<br>
uname -a<br>
Linux PCPHSFT79 2.6.32-31-generic #61-Ubuntu SMP Fri Apr 8 18:25:51 UTC<br>
2011 x86_64 GNU/Linux<br>
<br>
cat clang_fails.cxx<br>
#include <string><br>
<br>
extern "C" int printf(const char* fmt, ...);<br>
<br>
int main () {<br>
   std::string a = "a";<br>
   printf("%s\n", a.c_str());<br>
   return 0;<br>
}<br>
<br>
../Debug+Asserts/bin/clang clang_fails.cxx<br>
In file included from clang_fails.cxx:1:<br>
In file included from /usr/include/c++/4.4/string:41:<br>
<div class="im">In file included from /usr/include/c++/4.4/bits/char_traits.h:40:<br>
</div>In file included from /usr/include/c++/4.4/bits/stl_algobase.h:65:<br>
/usr/include/c++/4.4/ext/numeric_traits.h:60:25: error: expected member<br>
name or ';' after declaration specifiers<br>
       static const bool __is_signed = __glibcxx_signed(_Value);<br>
       ~~~~~~~~~~~~~~~~~ ^<br>
/usr/include/c++/4.4/ext/numeric_traits.h:71:50: error: expected<br>
unqualified-id<br>
     const bool __numeric_traits_integer<_Value>::__is_signed;<br>
                                                  ^<br>
/usr/include/c++/4.4/ext/numeric_traits.h:103:25: error: expected member<br>
name or ';' after declaration specifiers<br>
       static const bool __is_signed = true;<br>
       ~~~~~~~~~~~~~~~~~ ^<br>
/usr/include/c++/4.4/ext/numeric_traits.h:112:51: error: expected<br>
unqualified-id<br>
     const bool __numeric_traits_floating<_Value>::__is_signed;<br>
                                                   ^<br>
In file included from clang_fails.cxx:1:<br>
In file included from /usr/include/c++/4.4/string:41:<br>
<div class="im">In file included from /usr/include/c++/4.4/bits/char_traits.h:40:<br>
</div>/usr/include/c++/4.4/bits/stl_algobase.h:925:49: error: expected<br>
unqualified-id<br>
&& !__gnu_cxx::__numeric_traits<_ValueType1>::__is_signed<br>
                                                        ^<br>
/usr/include/c++/4.4/bits/stl_algobase.h:930:45: error: non-type<br>
template argument of type 'const bool' is not an integral constant<br>
expression<br>
       return std::__lexicographical_compare<__simple>::__lc(__first1,<br>
__last1,<br>
                                             ^~~~~~~~<br>
6 errors generated.<br>
<br>
I don't think this is expected. Is it?<br>
<font color="#888888"><br>
Vassil<br>
</font><div><div></div><div class="h5"><br>
On 04/28/2011 01:52 PM, Fletcher, John P wrote:<br>
> Christopher<br>
><br>
> Both -std=gnu++0x and -std=c++0x give errors in the GNU headers for gcc 4.4 (the default version of gcc on my ubuntu system)<br>
><br>
> fletcher@fletcher-desktop:~/test$ gcc --version<br>
> gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3<br>
> Copyright (C) 2009 Free Software Foundation, Inc.<br>
> This is free software; see the source for copying conditions.  There is NO<br>
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.<br>
><br>
> These errors may relate to c++0x things not yet implemented in Clang, or it could be that I need a different set of g++ headers.  I cannot tell.  Some problems are in<iostream>  and some caused by clang/Basic/Version (clang 2.9)<br>


><br>
> John<br>
><br>
><br>
> fletcher@fletcher-desktop:~/test$ make testcpp_cpp0x<br>
> /home/fletcher/LLVM/llvm/bin/clang++ -I/home/fletcher/LLVM/llvm/include -std=gnu++0x -DCLANG testcpp.cpp -otestcpp_cpp0x -L/home/fletcher/LLVM/llvm/lib -lclangBasic -lLLVMSupport -lpthread -ldl<br>
> In file included from testcpp.cpp:47:<br>
> In file included from /usr/include/c++/4.4/iostream:39:<br>
> In file included from /usr/include/c++/4.4/ostream:39:<br>
> In file included from /usr/include/c++/4.4/ios:39:<br>
> In file included from /usr/include/c++/4.4/exception:148:<br>
> /usr/include/c++/4.4/exception_ptr.h:143:13: error: unknown type name<br>
>        'type_info'<br>
>        const type_info*<br>
>              ^<br>
> In file included from testcpp.cpp:47:<br>
> In file included from /usr/include/c++/4.4/iostream:39:<br>
> In file included from /usr/include/c++/4.4/ostream:39:<br>
> In file included from /usr/include/c++/4.4/ios:40:<br>
> In file included from /usr/include/c++/4.4/bits/char_traits.h:40:<br>
> In file included from /usr/include/c++/4.4/bits/stl_algobase.h:66:<br>
> /usr/include/c++/4.4/bits/stl_pair.h:255:27: error: no matching function for<br>
>        call to 'forward'<br>
>          (std::forward<_T1>(__x), std::forward<_T2>(__y));<br>
>                                   ^~~~~~~~~~~~~~~~~<br>
> In file included from testcpp.cpp:49:<br>
> In file included from /home/fletcher/LLVM/llvm/include/clang/Basic/Version.h:18:<br>
> /home/fletcher/LLVM/llvm/include/llvm/ADT/StringRef.h:363:16: note: in<br>
>        instantiation of function template specialization 'std::make_pair<const<br>
>        llvm::StringRef&, llvm::StringRef>' requested here<br>
>          return std::make_pair(*this, StringRef());<br>
>                 ^<br>
> In file included from testcpp.cpp:47:<br>
> In file included from /usr/include/c++/4.4/iostream:39:<br>
> In file included from /usr/include/c++/4.4/ostream:39:<br>
> In file included from /usr/include/c++/4.4/ios:40:<br>
> In file included from /usr/include/c++/4.4/bits/char_traits.h:40:<br>
> In file included from /usr/include/c++/4.4/bits/stl_algobase.h:66:<br>
> In file included from /usr/include/c++/4.4/bits/stl_pair.h:60:<br>
> /usr/include/c++/4.4/bits/move.h:51:5: note: candidate function [with _Tp =<br>
>        llvm::StringRef] not viable: no known conversion from 'llvm::StringRef' to<br>
>        'typename std::identity<StringRef>::type&&' (aka 'llvm::StringRef&&')<br>
>        for 1st argument<br>
>      forward(typename std::identity<_Tp>::type&&  __t)<br>
>      ^<br>
> /usr/include/c++/4.4/bits/move.h:57:14: error: binding of reference to type<br>
>        'typename std::remove_reference<StringRef&>::type'<br>
>        (aka 'llvm::StringRef') to a value of type 'llvm::StringRef' drops<br>
>        qualifiers<br>
>      { return __t; }<br>
>               ^~~<br>
> In file included from testcpp.cpp:47:<br>
> In file included from /usr/include/c++/4.4/iostream:39:<br>
> In file included from /usr/include/c++/4.4/ostream:39:<br>
> In file included from /usr/include/c++/4.4/ios:40:<br>
> In file included from /usr/include/c++/4.4/bits/char_traits.h:40:<br>
> In file included from /usr/include/c++/4.4/bits/stl_algobase.h:66:<br>
> /usr/include/c++/4.4/bits/stl_pair.h:93:15: note: in instantiation of function<br>
>        template specialization 'std::move<llvm::StringRef&>' requested here<br>
>        : first(std::move(__p.first)),<br>
>                ^<br>
> In file included from testcpp.cpp:49:<br>
> In file included from /home/fletcher/LLVM/llvm/include/clang/Basic/Version.h:18:<br>
> /home/fletcher/LLVM/llvm/include/llvm/ADT/StringRef.h:363:16: note: in<br>
>        instantiation of member function 'std::pair<llvm::StringRef,<br>
>        llvm::StringRef>::pair' requested here<br>
>          return std::make_pair(*this, StringRef());<br>
>                 ^<br>
> In file included from testcpp.cpp:47:<br>
> In file included from /usr/include/c++/4.4/iostream:39:<br>
> In file included from /usr/include/c++/4.4/ostream:39:<br>
> In file included from /usr/include/c++/4.4/ios:40:<br>
> In file included from /usr/include/c++/4.4/bits/char_traits.h:40:<br>
> In file included from /usr/include/c++/4.4/bits/stl_algobase.h:66:<br>
> /usr/include/c++/4.4/bits/stl_pair.h:255:3: error: no matching function for call<br>
>        to 'forward'<br>
>          (std::forward<_T1>(__x), std::forward<_T2>(__y));<br>
>           ^~~~~~~~~~~~~~~~~<br>
> In file included from testcpp.cpp:49:<br>
> In file included from /home/fletcher/LLVM/llvm/include/clang/Basic/Version.h:18:<br>
> /home/fletcher/LLVM/llvm/include/llvm/ADT/StringRef.h:364:14: note: in<br>
>        instantiation of function template specialization<br>
>        'std::make_pair<llvm::StringRef, llvm::StringRef>' requested here<br>
>        return std::make_pair(slice(0, Idx), slice(Idx+1, npos));<br>
>               ^<br>
> In file included from testcpp.cpp:47:<br>
> In file included from /usr/include/c++/4.4/iostream:39:<br>
> In file included from /usr/include/c++/4.4/ostream:39:<br>
> In file included from /usr/include/c++/4.4/ios:40:<br>
> In file included from /usr/include/c++/4.4/bits/char_traits.h:40:<br>
> In file included from /usr/include/c++/4.4/bits/stl_algobase.h:66:<br>
> In file included from /usr/include/c++/4.4/bits/stl_pair.h:60:<br>
> /usr/include/c++/4.4/bits/move.h:51:5: note: candidate function [with _Tp =<br>
>        llvm::StringRef] not viable: no known conversion from 'llvm::StringRef' to<br>
>        'typename std::identity<StringRef>::type&&' (aka 'llvm::StringRef&&')<br>
>        for 1st argument<br>
>      forward(typename std::identity<_Tp>::type&&  __t)<br>
>      ^<br>
> 4 errors generated.<br>
> make: *** [testcpp_cpp0x] Error 1<br>
><br>
> ________________________________________<br>
> From: <a href="mailto:cfe-dev-bounces@cs.uiuc.edu">cfe-dev-bounces@cs.uiuc.edu</a> [<a href="mailto:cfe-dev-bounces@cs.uiuc.edu">cfe-dev-bounces@cs.uiuc.edu</a>] on behalf of Christopher Jefferson [<a href="mailto:chris@bubblescope.net">chris@bubblescope.net</a>]<br>


> Sent: 27 April 2011 08:49<br>
> To: Fletcher, John P<br>
> Cc: cfe-dev Developers<br>
> Subject: Re: [cfe-dev] Clang C++0x extensions<br>
><br>
> On 26 Apr 2011, at 17:59, Fletcher, John P wrote:<br>
><br>
>> Is there a specific command option to enable Clang C++0x extensions?  I have been looking through the manual and cannot find this.<br>
> You probably want -std=gnu++0x.<br>
><br>
> You can use -std=c++0x, but that disables gnu extensions. The default flag is  -std=gnu++03, and quite a bit of code (including last time I checked the standard header<cmath>  on mac os x) won't compile in c++03 or c++0x mode.<br>


><br>
> Chris<br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
><br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br>