f4a2713ac8
Change-Id: Ia40e9ffdf29b5dab2f122f673ff6802a58bc690f
28 lines
546 B
C++
28 lines
546 B
C++
// No PCH:
|
|
// RUN: %clang_cc1 -pedantic -std=c++1y -include %s -verify %s
|
|
//
|
|
// With PCH:
|
|
// RUN: %clang_cc1 -pedantic -std=c++1y -emit-pch %s -o %t
|
|
// RUN: %clang_cc1 -pedantic -std=c++1y -include-pch %t -verify %s
|
|
|
|
#ifndef HEADER
|
|
#define HEADER
|
|
|
|
auto counter = [a(0)] () mutable { return a++; };
|
|
int x = counter();
|
|
|
|
template<typename T> void f(T t) {
|
|
[t(t)] { int n = t; } ();
|
|
}
|
|
|
|
#else
|
|
|
|
int y = counter();
|
|
|
|
void g() {
|
|
f(0); // ok
|
|
// expected-error@15 {{lvalue of type 'const char *const'}}
|
|
f("foo"); // expected-note {{here}}
|
|
}
|
|
|
|
#endif
|