class.c (note_name_declared_in_class): Make declaration changes meaning a pedwarn.

2007-02-23  Richard Guenther  <rguenther@suse.de>

	* class.c (note_name_declared_in_class): Make declaration
	changes meaning a pedwarn.

	* g++.dg/warn/changes-meaning.C: New testcase.

From-SVN: r122255
This commit is contained in:
Richard Guenther 2007-02-23 11:08:39 +00:00 committed by Richard Biener
parent 95764a8f6e
commit 2ae2031ec1
4 changed files with 23 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2007-02-23 Richard Guenther <rguenther@suse.de>
* class.c (note_name_declared_in_class): Make declaration
changes meaning a pedwarn.
2007-02-22 Michael Matz <matz@suse.de>
PR c++/29433

View File

@ -6299,8 +6299,8 @@ note_name_declared_in_class (tree name, tree decl)
A name N used in a class S shall refer to the same declaration
in its context and when re-evaluated in the completed scope of
S. */
error ("declaration of %q#D", decl);
error ("changes meaning of %qD from %q+#D",
pedwarn ("declaration of %q#D", decl);
pedwarn ("changes meaning of %qD from %q+#D",
DECL_NAME (OVL_CURRENT (decl)), (tree) n->value);
}
}

View File

@ -1,3 +1,7 @@
2007-02-23 Richard Guenther <rguenther@suse.de>
* g++.dg/warn/changes-meaning.C: New testcase.
2007-02-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/30910

View File

@ -0,0 +1,11 @@
/* { dg-do compile } */
/* { dg-options "-fpermissive" } */
template <class _Tp> class auto_ptr {}; /* { dg-warning "changes meaning" } */
template <class _Tp>
class counted_ptr
{
public:
auto_ptr<_Tp> auto_ptr(); /* { dg-warning "" } */
};