[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaTemplate / instantiate-array.cpp
blob41d1cfe138ab5cacce83ab50bd9763d0c5061e49
1 // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
2 // expected-no-diagnostics
4 #ifndef __GXX_EXPERIMENTAL_CXX0X__
5 #define __CONCAT(__X, __Y) __CONCAT1(__X, __Y)
6 #define __CONCAT1(__X, __Y) __X ## __Y
8 #define static_assert(__b, __m) \
9 typedef int __CONCAT(__sa, __LINE__)[__b ? 1 : -1]
10 #endif
12 template <int N> class IntArray {
13 int elems[N];
16 static_assert(sizeof(IntArray<10>) == sizeof(int) * 10, "Array size mismatch");
17 static_assert(sizeof(IntArray<1>) == sizeof(int) * 1, "Array size mismatch");
19 template <typename T> class TenElementArray {
20 int elems[10];
23 static_assert(sizeof(TenElementArray<int>) == sizeof(int) * 10, "Array size mismatch");
25 template<typename T, int N> class Array {
26 T elems[N];
29 static_assert(sizeof(Array<int, 10>) == sizeof(int) * 10, "Array size mismatch");