gcc/testsuite/g++.dg/template/func2.C
raw| 1 | // { dg-do compile } |
| 2 | |
| 3 | typedef void (*fptr)(); |
| 4 | fptr zeroptr = 0; |
| 5 | template<typename T, fptr F> struct foo { }; |
| 6 | template<typename T> struct foo<T,zeroptr> { }; |
| 7 | // { dg-error "not a valid template argument" "not valid" { target *-*-* } .-1 } |
| 8 | // { dg-message "must be the address" "must be the address " { target *-*-* } .-2 } |
| 9 | |
| 10 | // The rest is needed to trigger the ICE in 4.0 to 4.3: |
| 11 | void f() { } |
| 12 | foo<int,&f> m_foo; |