Error compiling llvm/clang with clang+libc++ with -std=cxx0x

Hi All,
    I'm using LLVM/Clang 3.1 release.

    I first compiled llvm/clang using GCC per the instructions on the web with cmake. I then compiled libc++ per the instructions on the web. I then tried to compile llvm/clang with previously compiled clang and libc++ using "-std=c++0x -stdlib=libc++" flags. But the compilation fails at:

[ 58%] Building CXX object tools/bugpoint/CMakeFiles/bugpoint.dir/ToolRunner.cpp.o
clang-3: warning: argument unused during compilation: '-stdlib=libc++'
clang-3: warning: argument unused during compilation: '-L/local/mnt/workspace/ashoknn/519_libcxx_transition/llvm/build/../../libcxx.artifacts/linux-clang/lib'
/local/mnt/workspace/ashoknn/519_libcxx_transition/llvm/src/tools/bugpoint/ToolRunner.cpp:131:12: error: invalid operands to binary expression ('llvm::raw_ostream' and 'std::ostringstream'
      (aka 'basic_ostringstream<char>'))
    errs() << OS;
    ~~~~~~ ^ ~~

    If I remove the -std=c++0x, then the compilation is successful. I checked to see if libc++ itself was compiled with the flag and indeed it was.

   Any pointers?

TIA,
Ashok

...

/local/mnt/workspace/ashoknn/519_libcxx_transition/llvm/src/tools/bugpoint/ToolRunner.cpp:131:12: error: invalid operands to binary expression ('llvm::raw_ostream' and 'std::ostringstream'
      (aka 'basic_ostringstream<char>'))
    errs() << OS;
    ~~~~~~ ^ ~~

Hi Ashok, please try applying this diff from r155978 to your 3.1 release tree:

--- llvm/trunk/tools/bugpoint/ToolRunner.cpp 2012/05/02 05:31:31 155977
+++ llvm/trunk/tools/bugpoint/ToolRunner.cpp 2012/05/02 05:39:10 155978
@@ -128,7 +128,7 @@
       ErrorFile.close();
     }

- errs() << OS;
+ errs() << OS.str();
   }

   return ReturnCode;

Thanks Dimitry. That worked.

I see some warnings in my compilations:

Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/IntEqClasses.cpp.o
[ 2%] clang-3: warning: argument unused during compilation: '-nostdinc++'
Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/IntrusiveRefCntPtr.cpp.o
clang-3: warning: argument unused during compilation: '-stdlib=libc++'

Is that expected? I'm using both -stdlib=libc++ and -std=cxx0x. I dont see them when I used just -stdlib=libc++ flag.

Thanks,
Ashok

Second try, is the following warning a cause for concern? I dont know if it has any side affect. I want to enable c++0x support in llvm/clang and use libc++ as well.