Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp1z/constexpr-if12.C @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 1830386684a0 |
children |
rev | line source |
---|---|
111 | 1 // PR c++/80562 |
131 | 2 // { dg-do compile { target c++17 } } |
111 | 3 |
4 struct T { | |
145 | 5 int i; |
111 | 6 constexpr auto foo() { return false; } |
7 }; | |
8 | |
9 template <class MustBeTemplate> | |
10 constexpr auto bf(T t) { | |
145 | 11 if constexpr(t.foo()) { |
111 | 12 return false; |
13 } | |
14 return true; | |
15 } |