class.c (note_name_declared_in_class): Make in 'extern "C"' blocks...

2010-08-17  Kai Tietz  <kai.tietz@onevision.com>

        * class.c (note_name_declared_in_class): Make in 'extern "C"' blocks,
        or if -fms-extensions is enabled check, check permissive.

From-SVN: r163300
This commit is contained in:
Kai Tietz 2010-08-17 09:52:30 +00:00 committed by Kai Tietz
parent f9abf412e2
commit 8ce1235bfa
2 changed files with 12 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2010-08-17 Kai Tietz <kai.tietz@onevision.com>
* class.c (note_name_declared_in_class): Make in 'extern "C"' blocks,
or if -fms-extensions is enabled check, check permissive.
2010-08-09 Jason Merrill <jason@redhat.com>
PR c++/45236

View File

@ -6807,7 +6807,13 @@ note_name_declared_in_class (tree name, tree decl)
= current_class_stack[current_class_depth - 1].names_used;
if (!names_used)
return;
/* The C language allows members to be declared with a type of the same
name, and the C++ standard says this diagnostic is not required. So
allow it in extern "C" blocks unless predantic is specified.
Allow it in all cases if -ms-extensions is specified. */
if ((!pedantic && current_lang_name == lang_name_c)
|| flag_ms_extensions)
return;
n = splay_tree_lookup (names_used, (splay_tree_key) name);
if (n)
{