ahatanak added a comment.
In https://reviews.llvm.org/D36915#849622, @faisalv wrote:
> I don't think this approach is entirely correct for at least the following
> reasons:
>
> 1. in the lambda case the machinery that diagnoses capture failures should be
> the machinery erroring on the lambda (when the parameter is odr-used)
> 2. in the unevaluated case, once you disable the error, the instantiation
> machinery will fail to find the corresponding instantiated parmvardecl.
Oh right, it stills assert in the unevaluated case. I should have a test case
for that too.
I also found that the following code, which has a lambda that doesn't capture
anything, asserts (in IRGen):
struct S {
template<class T>
S(T&&) {}
};
template<class T>
void foo1() {
struct S2 {
void foo2(S s = [](){}) {
}
};
S2 s2;
s2.foo2();
}
void foo3() {
foo1<int>();
}
https://reviews.llvm.org/D36915
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits