public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/50748] New: Incorrect error message for lambda inside static member function
@ 2011-10-16 19:40 velok at mail dot ru
  2011-10-16 22:57 ` [Bug c++/50748] [C++0x] " paolo.carlini at oracle dot com
  0 siblings, 1 reply; 2+ messages in thread
From: velok at mail dot ru @ 2011-10-16 19:40 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/50748] [C++0x] Incorrect error message for lambda inside static member function
  2011-10-16 19:40 [Bug c++/50748] New: Incorrect error message for lambda inside static member function velok at mail dot ru
@ 2011-10-16 22:57 ` paolo.carlini at oracle dot com
  0 siblings, 0 replies; 2+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-10-16 22:57 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50748

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
            Summary|Incorrect error message for |[C++0x] Incorrect error
                   |lambda inside static member |message for lambda inside
                   |function                    |static member function

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-10-16 22:57:39 UTC ---
Already fixed in 4.6.x and mainline.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-16 22:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-16 19:40 [Bug c++/50748] New: Incorrect error message for lambda inside static member function velok at mail dot ru
2011-10-16 22:57 ` [Bug c++/50748] [C++0x] " paolo.carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).