Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/warn/Wtype-limits4.C @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 2b5abeee2509 |
children |
rev | line source |
---|---|
152 | 1 // PR c++/94938 |
2 // { dg-additional-options "-Wtype-limits" } | |
3 | |
4 template<unsigned N> struct B { unsigned arr[N]; }; | |
5 template<> struct B<1u> { int arr[10]; }; | |
6 | |
7 template <unsigned N> bool | |
8 foo(B<N> l) | |
9 { | |
10 int i = 0; | |
11 return l.arr[i] < 0; | |
12 } | |
13 | |
14 void | |
15 j() | |
16 { | |
17 B<1u> b; | |
18 foo (b); | |
19 B<2u> b2; | |
20 // I think that in this instantiation we could warn, but it breaks | |
21 // gcc bootstrap (marek 5/2020). | |
22 foo (b2); | |
23 } |