| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s |
| 2 |
|
| 3 |
// Make sure we correctly treat __typeof as potentially-evaluated when appropriate |
| 4 |
template<typename T> void f(T n) { // expected-note {{declared here}} |
| 5 |
int buffer[n]; // expected-warning {{variable length arrays in C++ are a Clang extension}} \ |
| 6 |
expected-note {{function parameter 'n' with unknown value cannot be used in a constant expression}} |
| 7 |
[&buffer] { __typeof(buffer) x; }(); |
| 8 |
} |
| 9 |
int main() { |
| 10 |
f<int>(1); // expected-note {{in instantiation of function template specialization 'f<int>' requested here}} |
| 11 |
} |