Mercurial > hg > CbC > CbC_llvm
view clang/test/PCH/cxx1y-init-captures.cpp @ 222:81f6424ef0e3 llvm-original
LLVM original branch
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 18 Jul 2021 22:10:01 +0900 |
parents | 79ff65ed7e25 |
children | 1f2b6ac9f198 |
line wrap: on
line source
// 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 // RUN: %clang_cc1 -pedantic -std=c++1y -emit-pch -fpch-instantiate-templates %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@18 {{lvalue of type 'const char *const'}} f("foo"); // expected-note {{here}} } #endif