From patchwork Mon Aug 16 19:59:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [c++] : Make structure in exten C block and for -fms-extension more permissive. Date: Mon, 16 Aug 2010 09:59:27 -0000 From: Kai Tietz X-Patchwork-Id: 61831 Message-Id: To: GCC Patches , Jason Merrill Hello, This patch allows the use of typedef'ed names as arguments in structures, if the structure is defined in an external C block. By this handling gets more similar to C. If the the option -fms-extensions is enabled, this is also allowed for class in C++ - like the option -fpermissive. This adjustments helps mingw and wine to mimic the behavior of VC in such cases better. ChangeLog for gcc/cp 2010-08-16 Kai Tietz * class.c (note_name_declared_in_class): Make in 'extern "C"' blocks, or if -fms-extensions is enabled check, check permissive. Patch tested for x86_64-w64-mingw32 and i686-w64-mingw32. Ok for apply? Kai Index: class.c =================================================================== --- class.c (revision 163283) +++ class.c (working copy) @@ -6807,7 +6807,9 @@ = current_class_stack[current_class_depth - 1].names_used; if (!names_used) return; - + if ((!pedantic && current_lang_name == lang_name_c) + || flag_ms_extensions) + return; n = splay_tree_lookup (names_used, (splay_tree_key) name); if (n) {