Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / g++.dg / template / sfinae2.C
blobe39ca6b76aac520c2377334e4b625ec6cbce21bc
1 // PR c++/19989
2 // Don't instantiate a function template if it would generate an
3 //   array of size zero.
5 // { dg-do compile }
7 template<int T> struct cl {
8   const static int value = T;
9 };
11 template<int I> void fn (char (*) [cl<I>::value] = 0 ); // { dg-message "note" }
13 void foo (void)
15   fn<0> ();  // { dg-error "no matching function" }
16   // { dg-message "candidate" "candidate note" { target *-*-* } 15 }