r174307 - in /trunk/gcc: cp/ChangeLog cp/name-l...

froydnj@gcc.gnu.org froydnj@gcc.gnu.org
Thu May 26 20:15:00 GMT 2011


Author: froydnj
Date: Thu May 26 20:15:22 2011
New Revision: 174307

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174307
Log:
detect C++ errors to fix 2288 and 18770
gcc/cp/
	PR c++/2288
	PR c++/18770
	* name-lookup.h (enum scope_kind): Add sk_cond.
	* name-lookup.c (pushdecl_maybe_friend): Get scope of shadowed local.
	Detect and report error for redeclaration from for-init or if
	or switch condition.
	(begin_scope): Handle sk_cond.
	* semantics.c (begin_if_stmt): Use sk_cond.
	(begin switch_stmt): Ditto.
gcc/testsuite/
	PR c++/2288
	PR c++/18770
	* g++.old-deja/g++.jason/cond.C: Remove xfails.
	* g++.dg/parse/pr18770.C: New test.
	* g++.dg/cpp0x/range-for5.C: Add dg-error marker.

Added:
    trunk/gcc/testsuite/g++.dg/parse/pr18770.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/name-lookup.c
    trunk/gcc/cp/name-lookup.h
    trunk/gcc/cp/semantics.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/cpp0x/range-for5.C
    trunk/gcc/testsuite/g++.old-deja/g++.jason/cond.C



More information about the Gcc-cvs mailing list