clang++ and extended initializer lists

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

clang++ and extended initializer lists

Csaba Raduly
Hi all,

I built clang version 2.9 (trunk 122051) on OpenSUSE 11.3 x86_64 using
its default compiler: gcc version 4.5.0 20100604 [gcc-4_5-branch
revision 160292] (SUSE Linux)
Then I tried to build clang with the newly built clang (configured in
another directory with CC=$HOME/bin/clang CXX=$HOME/bin/clang++), but
got the following error:

llvm[1]: Compiling Disassembler.cpp for Release+Asserts build
In file included from /home/csabe/LLVM/llvm/lib/Support/Disassembler.cpp:19:
/usr/include/c++/4.5/iomanip:63:12: error: expected expression
  { return { __mask }; }

This is because GCC's headers in this version use extended initializer lists:

  struct _Resetiosflags { ios_base::fmtflags _M_mask; };

  /**
   *  @brief  Manipulator for @c setf.
   *  @param  mask  A format flags mask.
   *
   *  Sent to a stream object, this manipulator resets the specified flags,
   *  via @e stream.setf(0,mask).
  */
  inline _Resetiosflags
  resetiosflags(ios_base::fmtflags __mask)
  { return { __mask }; }

When compiling a hand-made equivalent of the above, G++ warns
"extended initializer lists only available with -std=c++0x or
-std=gnu++0x". clang++ refuses to accept this even with -std=c++0x :(

Is this something that is not yet supported by clang++ ?

Csaba
--
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: clang++ and extended initializer lists

Sebastian Redl
On 17.12.2010 11:49, Csaba Raduly wrote:
> Is this something that is not yet supported by clang++ ?
Correct, see http://clang.llvm.org/cxx_status.html .

Clang doesn't reliably support libstdc++ > 4.2, since that's when they
started to use C++0x features.

Sebastian
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev