• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
2 
3 // Make sure we correctly treat __typeof as potentially-evaluated when appropriate
f(T n)4 template<typename T> void f(T n) {
5   int buffer[n]; // expected-note {{declared here}}
6   [] { __typeof(buffer) x; }(); // expected-error {{variable 'buffer' with variably modified type cannot be captured in a lambda expression}}
7 }
main()8 int main() {
9   f<int>(1); // expected-note {{in instantiation}}
10 }
11