brintos

brintos / llvm-project-archived public Read only

0
0
Text · 591 B · bc6027f Raw
12 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s2 3// Make sure we correctly treat __typeof as potentially-evaluated when appropriate4template<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}9int main() {10  f<int>(1); // expected-note {{in instantiation of function template specialization 'f<int>' requested here}}11}12