This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50748] New: Incorrect error message for lambda inside static member function
- From: "velok at mail dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 16 Oct 2011 19:40:35 +0000
- Subject: [Bug c++/50748] New: Incorrect error message for lambda inside static member function
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50748
Bug #: 50748
Summary: Incorrect error message for lambda inside static
member function
Classification: Unclassified
Product: gcc
Version: 4.5.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: velok@mail.ru
struct B
{
int member;
static void fn()
{
member = 0; // error: invalid use of member 'B::member'
// in static member function
auto lambda = [&]()
{
member = 0; // error: 'this' was not captured
// for this lambda function
};
}
};
Second error message is incorrect and confusing because there is no 'this' in
static function member. Error message might be the same.