1*f02455e5SDouglas Gregor // RUN: %clang_cc1 -std=c++11 %s -verify 2*f02455e5SDouglas Gregor test_reaching_scope()3*f02455e5SDouglas Gregorvoid test_reaching_scope() { 4*f02455e5SDouglas Gregor int local; // expected-note{{declared here}} 5*f02455e5SDouglas Gregor static int local_static; 6*f02455e5SDouglas Gregor (void)[=]() { 7*f02455e5SDouglas Gregor struct InnerLocal { 8*f02455e5SDouglas Gregor void member() { 9*f02455e5SDouglas Gregor (void)[=]() { 10*f02455e5SDouglas Gregor return local + // expected-error{{reference to local variable 'local' declared in enclosing function 'test_reaching_scope'}} 11*f02455e5SDouglas Gregor local_static; 12*f02455e5SDouglas Gregor }; 13*f02455e5SDouglas Gregor } 14*f02455e5SDouglas Gregor }; 15*f02455e5SDouglas Gregor }; 16*f02455e5SDouglas Gregor } 17