Commit 815951d8 by Simon Martin Committed by Simon Martin

re PR c++/27492 (ICE on invalid covariant return type)

2007-01-23  Simon Martin  <simartin@users.sourceforge.net>

	PR c++/27492
	* decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
	function decls.

From-SVN: r121089
parent a99e5cb4
2007-01-23 Simon Martin <simartin@users.sourceforge.net>
PR c++/27492
* decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
function decls.
2007-01-23 Ian Lance Taylor <iant@google.com>
* typeck.c (convert_for_assignment): Only warn about a = b = c
......
......@@ -1576,6 +1576,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
DECL_STATIC_DESTRUCTOR (newdecl) |= DECL_STATIC_DESTRUCTOR (olddecl);
DECL_PURE_VIRTUAL_P (newdecl) |= DECL_PURE_VIRTUAL_P (olddecl);
DECL_VIRTUAL_P (newdecl) |= DECL_VIRTUAL_P (olddecl);
DECL_INVALID_OVERRIDER_P (newdecl) |= DECL_INVALID_OVERRIDER_P (olddecl);
DECL_THIS_STATIC (newdecl) |= DECL_THIS_STATIC (olddecl);
if (DECL_OVERLOADED_OPERATOR_P (olddecl) != ERROR_MARK)
SET_OVERLOADED_OPERATOR_CODE
......
2007-01-23 Simon Martin <simartin@users.sourceforge.net>
PR c++/27492
* g++.dg/inherit/covariant15.C: New test.
2007-01-23 Ian Lance Taylor <iant@google.com>
* g++.dg/warn/Wparentheses-24.C: New test.
/* This used to ICE (PR c++/27492) */
/* { dg-do "compile" } */
struct A {};
class B : A
{
virtual A* foo(); /* { dg-error "overriding" } */
};
struct C : virtual B
{
virtual C* foo(); /* { dg-error "invalid covariant return type" } */
};
C* C::foo() { return 0; }
struct D : C {};
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