For this simple program (test.cc): ------------------------------------------------------------------------- template <typename Pred> void AssertPred(Pred pred) { pred("x", "y"); }
bool pred4(const char *, const char *, const char *x = "", const char *y = ""); bool pred2(const char *, const char *); void foof() { AssertPred(pred2); AssertPred(pred4); } ----------------------------------------------------------------------------- > $gcc421 -c test.ii (Success with gcc-4.2.1) > $gcc431 -c test.ii (Failure with gcc-4.3.1) test.ii: In function 'void AssertPred(Pred) [with Pred = bool (*)(const char*, const char*, const char*, const char*)]': test.ii: instantiated from here test.ii: error: too few arguments to function -- Summary: Functions with default parameters not correctly handled inside templates. Product: gcc Version: 4.3.1 Status: UNCONFIRMED Severity: major Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tmsriram at google dot com GCC build triplet: x86_64 GCC host triplet: x86_64 GCC target triplet: x86_64 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37088