summaryrefslogtreecommitdiff
path: root/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p11.cpp
blob: d265dd757398e89b08e770010562f060507d9af8 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// RUN: %clang_cc1 -std=c++11 %s -verify

void test_reaching_scope() {
  int local; // expected-note{{declared here}}
  static int local_static;
  (void)[=]() {
    struct InnerLocal {
      void member() {
        (void)[=]() {
          return local + // expected-error{{reference to local variable 'local' declared in enclosing function 'test_reaching_scope'}}
            local_static;
        };
      }
    };
  };
}