p11.cpp 423 B

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