This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/63320] New: [5 Regression] bogus âthisâ was not captured for this lambda function error


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63320

            Bug ID: 63320
           Summary: [5 Regression] bogus âthisâ was not captured for this
                    lambda function error
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: trippels at gcc dot gnu.org

Happened building qt-creator:

markus@x4 coreplugin % cat windowsupport.ii
class A {
  static void addWindow();
  static void activateWindow(void *);
};
void A::addWindow() {
  int* action {};
  [action] { activateWindow(action); };
}

markus@x4 coreplugin % g++ -c -std=c++14 windowsupport.ii
windowsupport.ii: In lambda function:
windowsupport.ii:7:35: error: âthisâ was not captured for this lambda function
   [action] { activateWindow(action); };
                                   ^
(4.9 and 4.8 are fine)
markus@x4 coreplugin % g++ -c -std=c++11 windowsupport.ii
markus@x4 coreplugin % icpc -c -std=c++11 windowsupport.ii
markus@x4 coreplugin % clang++ -w -c -std=c++11 windowsupport.ii
markus@x4 coreplugin %

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]