[cfe-dev] in class member initializations not working? (clang 3.0)

Ryan Ericson ryan.ericson at gmail.com
Wed Mar 7 17:23:26 PST 2012


Clang C++11 status page says that "Non static data member initializations"
is available in clang 3.0.

I'm on Xcode 4.3, clang++ --version gives this:
Apple clang version 3.1 (tags/Apple/clang-318.0.45) (based on LLVM 3.1svn)

This example fails to compile:
#include <string>
using namespace std;

struct foo
{
string s("aa");
};

With this error:
test3.cpp:6:11: error: expected parameter declarator
        string s("aa");
                 ^
test3.cpp:6:11: error: expected ')'
test3.cpp:6:10: note: to match this '('
        string s("aa");

Am I misunderstanding something? Thanks in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120307/d88f42da/attachment.html>


More information about the cfe-dev mailing list