Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

clang shipped with Xcode 4.3.2 crushed when compile c++11 lambda

clang shipped with Xcode 4.3.2 crushed when compile c++11 lambda code.

Code is very simple:

int main() {

auto f=[](){};

f();

}

Compile with:

clang++ -std=c++11 ll.cc


clang crushed at clang::Sema::AddInitializerToDecl with a long stack dump.

Same code compiles with GCC 4.6.1 on Ubuntu.

Posted on Mar 27, 2012 12:13 AM

Reply
5 replies

Mar 27, 2012 1:58 PM in response to WindozeVista

So?


The latest, bleeding edge of C++ has all sorts of similarly pointless examples that won't compile on this compiler or that one. If this one fails it doesn't mean there is anything wrong with Clang. By the same token, the similar GCC failures don't mean there is anything wrong with GCC.


C++ was so monstrously complex in 1998 that nobody ever managed to write a compiler for it. It sure isn't any better now. That is why people who actually want to get something done use C#, Objective-C, or C.

clang shipped with Xcode 4.3.2 crushed when compile c++11 lambda

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.