Commit ff771454 by Fabien Chêne

re PR c++/48010 (typedef redefinitions are allowed if the redefined type is a nested class type)

gcc/cp/ChangeLog

2010-05-31  Fabien Chene  <fabien@gcc.gnu.org>

	PR c++/48010
	* name-lookup.c (supplement_binding_1): If the old binding was a
	type name, also check that the DECL actually refers to the same
	type or is not a type.

gcc/testsuite/ChangeLog

2010-05-31  Fabien Chene  <fabien@gcc.gnu.org>

	PR c++/48010
	* g++.dg/lookup/name-clash9.C: New.

From-SVN: r174506
parent d73b65b6
2010-05-31 Fabien Chêne <fabien@gcc.gnu.org>
PR c++/48010
* name-lookup.c (supplement_binding_1): If the old binding was a
type name, also check that the DECL actually refers to the same
type or is not a type.
2011-05-31 Jason Merrill <jason@redhat.com>
PR c++/44870
......
/* Definitions for C++ name lookup routines.
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
......@@ -436,7 +436,9 @@ supplement_binding_1 (cxx_binding *binding, tree decl)
&& DECL_ANTICIPATED (bval)
&& !DECL_HIDDEN_FRIEND_P (bval)))
binding->value = decl;
else if (TREE_CODE (bval) == TYPE_DECL && DECL_ARTIFICIAL (bval))
else if (TREE_CODE (bval) == TYPE_DECL && DECL_ARTIFICIAL (bval)
&& (TREE_CODE (decl) != TYPE_DECL
|| same_type_p (TREE_TYPE (decl), TREE_TYPE (bval))))
{
/* The old binding was a type name. It was placed in
VALUE field because it was thought, at the point it was
......
2010-11-15 Fabien Chêne <fabien@gcc.gnu.org>
PR c++/48010
* g++.dg/lookup/name-clash9.C: New.
2011-05-31 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
......
// { dg-do compile }
// PR c++/48010
struct A
{
struct type {}; // { dg-error "conflicts with previous" }
typedef int type; // { dg-error "declaration" }
};
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