blob: 3c8fc149d84ba5b125cecf101f735dd25bdb262a [file] [log] [blame]
Richard Smithbb13c9a2013-09-28 04:02:39 +00001// 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#ifndef HEADER
9#define HEADER
10
11auto counter = [a(0)] () mutable { return a++; };
12int x = counter();
13
14template<typename T> void f(T t) {
15 [t(t)] { int n = t; } ();
16}
17
18#else
19
20int y = counter();
21
22void g() {
23 f(0); // ok
24 // expected-error@15 {{lvalue of type 'const char *const'}}
25 f("foo"); // expected-note {{here}}
26}
27
28#endif