This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch/c++] Fix PR 14688 (conflicting type attributes of virtual methods)


PR c++/14688 is due to failure to check if the type attributes of
virtual
methods in derived class conflict with type attributes in base class. As
the test case in the PR demonstate this can result in unexpected
behaviour when the function type attributes specify a calling
convention. 

Fixed by:

1) Checking METHOD_TYPEs as well as FUNCTION_TYPEs in the i386 version
of targetm.comp_type_attributes. Note I have _not_ made the
corresponding change to bfin_comp_type_attributes or
arm_comp_type_attributes so these targets are not affected. I suspect
that they too should check METHOD_TYPEs.

2) Using targetm.comp_type_attributes in cp/search.c
(check_final_overrider) to test for conflicts.

Bootstrapped and tested on i386-pc-mingw32 

OK for trunk?

:ADDPATCH c++:

ChangeLog
2007-09-18  Danny Smith  <dannysmith@user.sourceforge.net>
	PR c++/14688
	* config/i386/i386.c (ix86_comp_type_attributes): Check
	METHOD_TYPE too.

cp/ChangeLog

	PR c++/14688
        * search.c (check_final_overrider): Fail if
	targetm.comp_type_attributes returns 0.

testsuite/ChangeLog

	PR c++/14688
	* g++.dg/inherit/override_attribs.C: New file.

Attachment: pr14688.diff
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]