annotate clang/test/SemaTemplate/instantiate-array.cpp @ 266:00f31e85ec16 default tip

Added tag current for changeset 31d058e83c98
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 14 Oct 2023 10:13:55 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
anatofuz
parents:
diff changeset
2 // expected-no-diagnostics
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 #ifndef __GXX_EXPERIMENTAL_CXX0X__
anatofuz
parents:
diff changeset
5 #define __CONCAT(__X, __Y) __CONCAT1(__X, __Y)
anatofuz
parents:
diff changeset
6 #define __CONCAT1(__X, __Y) __X ## __Y
anatofuz
parents:
diff changeset
7
anatofuz
parents:
diff changeset
8 #define static_assert(__b, __m) \
anatofuz
parents:
diff changeset
9 typedef int __CONCAT(__sa, __LINE__)[__b ? 1 : -1]
anatofuz
parents:
diff changeset
10 #endif
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 template <int N> class IntArray {
anatofuz
parents:
diff changeset
13 int elems[N];
anatofuz
parents:
diff changeset
14 };
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 static_assert(sizeof(IntArray<10>) == sizeof(int) * 10, "Array size mismatch");
anatofuz
parents:
diff changeset
17 static_assert(sizeof(IntArray<1>) == sizeof(int) * 1, "Array size mismatch");
anatofuz
parents:
diff changeset
18
anatofuz
parents:
diff changeset
19 template <typename T> class TenElementArray {
anatofuz
parents:
diff changeset
20 int elems[10];
anatofuz
parents:
diff changeset
21 };
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23 static_assert(sizeof(TenElementArray<int>) == sizeof(int) * 10, "Array size mismatch");
anatofuz
parents:
diff changeset
24
anatofuz
parents:
diff changeset
25 template<typename T, int N> class Array {
anatofuz
parents:
diff changeset
26 T elems[N];
anatofuz
parents:
diff changeset
27 };
anatofuz
parents:
diff changeset
28
anatofuz
parents:
diff changeset
29 static_assert(sizeof(Array<int, 10>) == sizeof(int) * 10, "Array size mismatch");