[cfe-dev] Problem with libc++
devlists at shadowlab.org
Tue Apr 3 08:38:53 PDT 2012
Le 3 avr. 2012 à 17:20, Howard Hinnant a écrit :
> On Apr 3, 2012, at 10:36 AM, Dix Lorenz wrote:
>> I don't know if this is the right place for this, if not please direct me to a better place.
>> I just downloaded clang and libc++ trunk. This code fails:
>> #include <string>
>> #include <vector>
>> using namespace std;
>> int main(int argc, const char * argv)
>> vector<string> v;
>> v.push_back("Hello"); // <--- error here
>> return 0;
>> The error is "no viable overloaded '='". It seems as if moving strings is broken...
>> This is in Xcode 4.3.2 (with the include directory from libc++ trunk replacing /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/v1). If I switch to the "normal" clang Compiler in Xcode it works. If I switch from using "libc++" to "libstdc++" it also works, its the combination of the current clang and libc++ that have this problem.
>> /opt/bin/clang --version
>> clang version 3.1 (trunk 153948)
>> Target: x86_64-apple-darwin11.3.0
> This is looking like a clang problem. I've got TOT libc++, but a slightly older clang and I'm not seeing this behavior.
I don't think. I have a TOT clang & libc++, and don't have any issue. Probably a problem with the way clang and libc++ are used with Xcode.
More information about the cfe-dev