gcc/testsuite/g++.dg/template/dependent-name4.C
raw| 1 | // { dg-do compile } |
| 2 | |
| 3 | // Dependent arrays of invalid size cause template instantiation failure. |
| 4 | |
| 5 | // We'll get an error message (duplicate matching templates) if the first |
| 6 | // pattern is incorrectly allowed to match. |
| 7 | |
| 8 | template<int M> void foobar (int (*) [M] = 0 ); |
| 9 | template<int M> void foobar ( ); |
| 10 | |
| 11 | void fn (void) |
| 12 | { |
| 13 | foobar<0>(); |
| 14 | foobar<-1>(); |
| 15 | } |