brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 728f133 Raw
74 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -fdump-record-layouts-complete %s | FileCheck %s2 3struct a {4  int x;5};6 7struct b {8  char y;9} foo;10 11class c {};12 13class d;14 15template <typename>16struct s {17  int x;18};19 20template <typename T>21struct ts {22  T x;23};24 25template <>26struct ts<void> {27  float f;28};29 30void f() {31  ts<int> a;32  ts<double> b;33  ts<void> c;34}35 36namespace gh83671 {37template <class _Tp, _Tp __v>38struct integral_constant {39  static constexpr const _Tp value = __v;40  typedef integral_constant type;41};42 43template <bool _Val>44using _BoolConstant = integral_constant<bool, _Val>;45 46template <class _Tp, class _Up>47struct is_same : _BoolConstant<__is_same(_Tp, _Up)> {};48 49template < class _Tp >50class numeric_limits {};51 52template < class _Tp >53class numeric_limits< const _Tp > : public numeric_limits< _Tp > {};54}55 56namespace gh83684 {57template <class Pointer>58struct AllocationResult {59  Pointer ptr = nullptr;60  int count = 0;61};62}63 64// CHECK:          0 | struct a65// CHECK:          0 | struct b66// CHECK:          0 | class c67// CHECK:          0 | struct ts<void>68// CHECK-NEXT:     0 |   float69// CHECK:          0 | struct ts<int>70// CHECK:          0 | struct ts<double>71// CHECK-NOT:      0 | class d72// CHECK-NOT:      0 | struct s73// CHECK-NOT:      0 | struct AllocationResult74