decl.c (redeclaration_error_message): Complain when redeclaring a friend function...
authorDouglas Gregor <doug.gregor@gmail.com>
Wed, 28 Mar 2007 14:05:29 +0000 (14:05 +0000)
committerDoug Gregor <dgregor@gcc.gnu.org>
Wed, 28 Mar 2007 14:05:29 +0000 (14:05 +0000)
commit9b7dd5e868e5c3978ea8c6cfef383c2846321ddf
treec72b508351bff91028912e57668dee64204baa72
parente701c05c17884fb38917e613f42b000e57bacc57
decl.c (redeclaration_error_message): Complain when redeclaring a friend function with default template arguments...

2007-03-28  Douglas Gregor  <doug.gregor@gmail.com>

* decl.c (redeclaration_error_message): Complain when redeclaring
a friend function with default template arguments (C++0x mode only).
* cp-tree.h (check_default_tmpl_args): Declare.
* pt.c (check_default_tmpl_args): In C++0x mode, permit default
template arguments in function templates. Add support for checking
the default template arguments of friend templates.
(push_template_decl_real): Fix call to check_default_tmpl_args.
(type_unification_real): If a template parameter has not been
deduced but provides a default template argument, substitute into
that default template argument.
* parser.c (cp_parser_init_declarator): When declaring (but not
defining!) a function template in C++0x mode, check for default
template arguments.

2007-03-28  Douglas Gregor  <doug.gregor@gmail.com>

* g++.dg/cpp0x/temp_default1.C: New.
* g++.dg/cpp0x/temp_default3.C: New.
* g++.dg/cpp0x/temp_default2.C: New.
* g++.dg/cpp0x/temp_default4.C: New.

From-SVN: r123300
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/parser.c
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/temp_default1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/temp_default2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/temp_default3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/temp_default4.C [new file with mode: 0644]