1 // No PCH:
2 // RUN: %clang_cc1 -pedantic -std=c++1y -include %s -verify %s
3 //
4 // With PCH:
5 // RUN: %clang_cc1 -pedantic -std=c++1y -emit-pch %s -o %t
6 // RUN: %clang_cc1 -pedantic -std=c++1y -include-pch %t -verify %s
7 
8 // RUN: %clang_cc1 -pedantic -std=c++1y -emit-pch -fpch-instantiate-templates %s -o %t
9 // RUN: %clang_cc1 -pedantic -std=c++1y -include-pch %t -verify %s
10 
11 #ifndef HEADER
12 #define HEADER
13 
__anon38ecc3b70102() 14 auto counter = [a(0)] () mutable { return a++; };
15 int x = counter();
16 
f(T t)17 template<typename T> void f(T t) {
18   [t(t)] { int n = t; } ();
19 }
20 
21 #else
22 
23 int y = counter();
24 
g()25 void g() {
26   f(0); // ok
27   // expected-error@18 {{lvalue of type 'const char *const'}}
28   f("foo"); // expected-note {{here}}
29 }
30 
31 #endif
32