p1-0x.cpp revision 503384f731b5abcbf870b0a5224eb920e631db0a
1// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
2
3void f() {
4  int x = 3; // expected-note{{'x' declared here}}
5  const int c = 2;
6  struct C {
7    int& x2 = x; // expected-error{{reference to local variable 'x' declared in enclosing function 'f'}}
8    int cc = c;
9  };
10  (void)[]() mutable { // expected-error {{not supported yet}}
11    int x = 3; // expected-note{{'x' declared here}}
12    struct C {
13      int& x2 = x; // expected-error{{reference to local variable 'x' declared in enclosing lambda expression}}
14    };
15  };
16  C();
17}
18
19