This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch c++]: Make structure in exten C block and for -fms-extension more permissive.


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?


|? (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination

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)
+  if ((!pedantic && current_lang_name == lang_name_c)
+      || flag_ms_extensions)
+    return;
   n = splay_tree_lookup (names_used, (splay_tree_key) name);
   if (n)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]