KnowItAllWannabe
KnowItAllWannabe

Reputation: 13512

How get clang 3.4 to compile generic lambdas?

The compiler at rextester says it's running clang 3.4, and the clang language support page says that clang 3.4 supports generic lambdas, but I can't get this code to compile:

int main()
{
    auto genLambda = [](auto param) {};
}

I'm compiling with -std=c++1y. Compiling with --version results in the following, which is why I believe I'm running clang 3.4:

Ubuntu clang version 3.4-1ubuntu1 (trunk) (based on LLVM 3.4)
Target: x86_64-pc-linux-gnu
Thread model: posix

Any idea what I'm doing wrong?

Upvotes: 0

Views: 236

Answers (1)

OmnipotentEntity
OmnipotentEntity

Reputation: 17131

Using clang 3.4 on my computer with only --std=c++1y works with your example code.

Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4)

Because your --version references trunk it's probably an SVN copy of clang 3.4 which was obtained prior to generic lambdas being added to the code base.

Upvotes: 1

Related Questions