// Always skip the injected-class-name, along with any
// redeclarations of nested classes, since both would cause us
// to try to instantiate the members of a class twice.
- if (Record->isInjectedClassName() || Record->getPreviousDecl())
+ // Skip closure types; they'll get instantiated when we instantiate
+ // the corresponding lambda-expression.
+ if (Record->isInjectedClassName() || Record->getPreviousDecl() ||
+ Record->isLambda())
continue;
MemberSpecializationInfo *MSInfo = Record->getMemberSpecializationInfo();
} //end ns inclass_lambdas_within_nested_classes
+
+namespace lambda_in_default_mem_init {
+ template<typename T> void f() {
+ struct S { int n = []{ return 0; }(); };
+ }
+ template void f<int>();
+}