1// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
2
3// Make sure we correctly treat __typeof as potentially-evaluated when appropriate
4template<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}
8int main() {
9  f<int>(1); // expected-note {{in instantiation}}
10}
11