Commit e1d9e3db by Paolo Carlini Committed by Paolo Carlini

DR 217 again

/cp
2014-08-01  Paolo Carlini  <paolo.carlini@oracle.com>

	DR 217 again
	* decl.c (duplicate_decls): Handle static member functions too.

/testsuite
2014-08-01  Paolo Carlini  <paolo.carlini@oracle.com>

	DR 217 again
	* g++.dg/tc1/dr217-2.C: New.

From-SVN: r213505
parent a7f930e7
2014-08-01 Paolo Carlini <paolo.carlini@oracle.com>
DR 217 again
* decl.c (duplicate_decls): Handle static member functions too.
2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com> 2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
* cp-array-notation.c (expand_an_in_modify_expr): Fix the misprint * cp-array-notation.c (expand_an_in_modify_expr): Fix the misprint
......
...@@ -1706,14 +1706,11 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) ...@@ -1706,14 +1706,11 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
; ;
else if (TREE_CODE (olddecl) == FUNCTION_DECL) else if (TREE_CODE (olddecl) == FUNCTION_DECL)
{ {
tree t1 = TYPE_ARG_TYPES (TREE_TYPE (olddecl)); tree t1 = FUNCTION_FIRST_USER_PARMTYPE (olddecl);
tree t2 = TYPE_ARG_TYPES (TREE_TYPE (newdecl)); tree t2 = FUNCTION_FIRST_USER_PARMTYPE (newdecl);
int i = 1; int i = 1;
if (TREE_CODE (TREE_TYPE (newdecl)) == METHOD_TYPE) if (DECL_FUNCTION_MEMBER_P (newdecl)
t1 = TREE_CHAIN (t1), t2 = TREE_CHAIN (t2);
if (TREE_CODE (TREE_TYPE (newdecl)) == METHOD_TYPE
&& CLASSTYPE_TEMPLATE_INFO (CP_DECL_CONTEXT (newdecl))) && CLASSTYPE_TEMPLATE_INFO (CP_DECL_CONTEXT (newdecl)))
{ {
/* C++11 8.3.6/6. /* C++11 8.3.6/6.
......
2014-08-01 Paolo Carlini <paolo.carlini@oracle.com>
DR 217 again
* g++.dg/tc1/dr217-2.C: New.
2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com> 2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
PR other/61963 PR other/61963
......
// { dg-do compile }
// DR217: Default arguments for non-template member functions of class
// templates
template <class T>
struct S
{
static void foo (int);
};
template <class T>
void S<T>::foo (int = 0) // { dg-error "" "default arguments for parameters of member functions of class templates can be specified in the initial declaration only" }
{ }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment