Merge pull request #2121 from esdrubal/socketreuse
[mono.git] / mcs / mcs / cs-parser.jay
index 1f44fc2d566f552bfa6d025befb483173c70b08a..fb6a3e87873597f165ac3c175682518293449355 100644 (file)
@@ -400,6 +400,17 @@ outer_declaration
          }
        | opt_extern_alias_directives opt_using_directives attribute_sections
          {
+               Attributes attrs = (Attributes) $3;
+               if (attrs != null) {
+                       foreach (var a in attrs.Attrs) {
+                               if (a.ExplicitTarget == "assembly" || a.ExplicitTarget == "module")
+                                       continue;
+
+                               if (a.ExplicitTarget == null)
+                                       report.Error (-1671, a.Location, "Global attributes must have attribute target specified");
+                       }
+               }
+
                module.AddAttributes ((Attributes) $3, current_namespace);
          }
        | error
@@ -1858,6 +1869,9 @@ property_declaration
                if (type.Type != null && type.Type.Kind == MemberKind.Void)
                        report.Error (547, GetLocation ($3), "`{0}': property or indexer cannot have void type", property.GetSignatureForError ());
 
+               if (doc_support)
+                       property.DocComment = ConsumeStoredComment ();
+
                current_type.AddMember (property);
 
                current_local_parameters = null;
@@ -2403,12 +2417,7 @@ constructor_declarator
                        }
                } else {
                        if (current_type.Kind == MemberKind.Struct && current_local_parameters.IsEmpty) {
-                               if (lang_version < LanguageVersion.V_6)
-                                       FeatureIsNotAvailable (GetLocation ($3), "struct parameterless instance constructor");
-
-                               if ((mods & Modifiers.PUBLIC) == 0) {
-                                       report.Error (8075, c.Location, "`{0}': Structs parameterless instance constructor must be public", c.GetSignatureForError ());
-                               }
+                               report.Error (568, c.Location, "Structs cannot contain explicit parameterless constructors");
                        }
                }