more_specialized_fn contains /* All things being equal, if the next argument is a pack expansion for one function but not for the other, prefer the non-variadic function. */ if ((better1 > 0) - (better2 > 0) == 0 && args1 && TREE_VALUE (args1) && args2 && TREE_VALUE (args2)) { if (TREE_CODE (TREE_VALUE (args1)) == TYPE_PACK_EXPANSION) return TREE_CODE (TREE_VALUE (args2)) == TYPE_PACK_EXPANSION ? 0 : -1; else if (TREE_CODE (TREE_VALUE (args2)) == TYPE_PACK_EXPANSION) return 1; }
which makes us prefer a non-variadic option even when deduction failed in both directions, which makes variadic-crash1.C pass purely by accident. This also makes us prefer an unused default argument to a function parameter pack. -- Summary: [c++0x] bogus variadic partial ordering code Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jason at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41958