Index: doc/cpp.texi =================================================================== --- doc/cpp.texi (revision 396) +++ doc/cpp.texi (working copy) @@ -2128,7 +2128,7 @@ This macro is defined, with value 2, when @option{-fstack-protector-all} is in use. -@item__VARIADIC_TEMPLATES__ +@item__VARIADIC_TEMPLATES This macro is defined if support is provided for the variadic templates extension to C++. @end table Index: c-cppbuiltin.c =================================================================== --- c-cppbuiltin.c (revision 396) +++ c-cppbuiltin.c (working copy) @@ -335,7 +335,7 @@ if (warn_deprecated) cpp_define (pfile, "__DEPRECATED"); if (flag_variadic_templates) - cpp_define (pfile, "__VARIADIC_TEMPLATES__"); + cpp_define (pfile, "__VARIADIC_TEMPLATES"); } /* Note that we define this for C as well, so that we know if __attribute__((cleanup)) will interface with EH. */ Index: testsuite/g++.dg/template/variadic59.C =================================================================== --- testsuite/g++.dg/template/variadic59.C (revision 0) +++ testsuite/g++.dg/template/variadic59.C (revision 0) @@ -0,0 +1,3 @@ +template +void print(T t, VarArgs args); // { dg-error "packs not unpacked" } +// { dg-error "VarArgs" "" { target *-*-* } 2 } Index: cp/pt.c =================================================================== --- cp/pt.c (revision 396) +++ cp/pt.c (working copy) @@ -3458,6 +3458,12 @@ check_default_tmpl_args (decl, current_template_parms, primary, is_partial); + /* If this is a function template, ensure that there are no + parameter packs in the types of the parameters (or the return + type) that have not been unpacked. */ + if (TREE_CODE (decl) == FUNCTION_DECL) + check_for_bare_parameter_packs (TREE_TYPE (decl)); + if (is_partial) return process_partial_specialization (decl);