File: constexpr-many-arguments.cpp

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (43 lines) | stat: -rw-r--r-- 1,019 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// RUN: %clang_cc1 -std=c++11 -fsyntax-only %s
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -fexperimental-new-constant-interpreter %s
// PR13197

struct type1
{
  constexpr type1(int a0) : my_data{a0} {}
  int my_data[1];
};

struct type2
{
  typedef type1 T;
  constexpr type2(T a00, T a01, T a02, T a03, T a04, T a05, T a06, T a07, T a08, T a09,
                       T a10, T a11, T a12, T a13, T a14, T a15, T a16, T a17, T a18, T a19,
                       T a20, T a21, T a22) 
    : my_data{a00, a01, a02, a03, a04, a05, a06, a07, a08, a09,
              a10, a11, a12, a13, a14, a15, a16, a17, a18, a19,
              a20, a21, a22}
  {}
  type1 my_data[23];
};

struct type3
{
  constexpr type3(type2 a0, type2 a1) : my_data{a0, a1} {}
  type2 my_data[2];
};

constexpr type3 g
{
  {
   {0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
   {0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
   {0},{0},{0}
  }, 
  {
   {0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
   {0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
   {0},{0},{0}
  }
};