repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
PR c++/56973, DR 696 - capture constant variables only as needed.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp1y
/
constexpr-switch3.C
blob
1aa1cf6bbaee69b06621dafc6619f919593f512f
1
// { dg-do compile { target c++14 } }
2
3
constexpr int f (int i)
4
{
5
int j = 0;
6
switch (i)
7
{
8
case 1:
9
j = 42;
10
break;
11
default:
12
j = 24;
13
break;
14
}
15
return j;
16
}
17
18
constexpr int i = f(2);
19
#define SA(X) static_assert((X),#X)
20
SA(i==24);