150
|
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
|
221
|
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
|
150
|
11 #ifndef HEADER
|
|
12 #define HEADER
|
|
13
|
|
14 auto counter = [a(0)] () mutable { return a++; };
|
|
15 int x = counter();
|
|
16
|
|
17 template<typename T> void f(T t) {
|
|
18 [t(t)] { int n = t; } ();
|
|
19 }
|
|
20
|
|
21 #else
|
|
22
|
|
23 int y = counter();
|
|
24
|
|
25 void g() {
|
|
26 f(0); // ok
|
221
|
27 // expected-error@18 {{lvalue of type 'const char *const'}}
|
150
|
28 f("foo"); // expected-note {{here}}
|
|
29 }
|
|
30
|
|
31 #endif
|