While looking at this issue, I also noticed that we were substituting
into DECL_INITIAL more than we need to.
Tested x86_64-pc-linux-gnu, applying to trunk.
commit 327bbebe3243b0423932862d3d12f92928853e9c
Author: Jason Merrill
Date: Wed Jun 29 14:21:17 2011 -0400
* pt.c (tsubst_decl) [V
The failure in this testcase was happening because we were trying to
evaluate the capture decltype again when instantiating the lambda
operator(), but it only works when we're still in the enclosing function
context. Fixed by basically waiting to copy the type over at
instantiation time rather