Author: martin
Date: 2005-04-15 04:56:53 -0400 (Fri, 15 Apr 2005)
New Revision: 43036

Modified:
   trunk/mcs/gmcs/ChangeLog
   trunk/mcs/gmcs/codegen.cs
   trunk/mcs/gmcs/cs-parser.jay
   trunk/mcs/gmcs/driver.cs
   trunk/mcs/gmcs/expression.cs
Log:
**** Merged r41561 from MCS ****


Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog    2005-04-15 08:56:06 UTC (rev 43035)
+++ trunk/mcs/gmcs/ChangeLog    2005-04-15 08:56:53 UTC (rev 43036)
@@ -1,3 +1,17 @@
+2005-03-08  Marek Safar  <[EMAIL PROTECTED]>
+
+       * cs-parser.jay: Removed CS0134.
+       
+       * driver.cs: Removed CS1901.
+       
+       * expression.cs (SizeOf.DoResolve): Don't report CS0233
+       for predefined types.
+
+2005-03-07  Duncan Mak  <[EMAIL PROTECTED]>
+
+       * codegen.cs (Save):  Catch UnauthorizedAccessException as
+       well. Fixes bug #73454.
+
 2005-03-07  Marek Safar  <[EMAIL PROTECTED]>
 
        * cs-tokenizer.cs (xtoken): Add CS1035.

Modified: trunk/mcs/gmcs/codegen.cs
===================================================================
--- trunk/mcs/gmcs/codegen.cs   2005-04-15 08:56:06 UTC (rev 43035)
+++ trunk/mcs/gmcs/codegen.cs   2005-04-15 08:56:53 UTC (rev 43036)
@@ -172,6 +172,9 @@
                        catch (System.IO.IOException io) {
                                Report.Error (16, "Could not write to file 
`"+name+"', cause: " + io.Message);
                        }
+                       catch (System.UnauthorizedAccessException ua) {
+                               Report.Error (16, "Could not write to file 
`"+name+"', cause: " + ua.Message);
+                       }
 
                        if (SymbolWriter != null)
                                SymbolWriter.WriteSymbolFile ();

Modified: trunk/mcs/gmcs/cs-parser.jay
===================================================================
--- trunk/mcs/gmcs/cs-parser.jay        2005-04-15 08:56:06 UTC (rev 43035)
+++ trunk/mcs/gmcs/cs-parser.jay        2005-04-15 08:56:53 UTC (rev 43036)
@@ -372,11 +372,6 @@
 
                if (name.TypeArguments != null)
                        syntax_error (lexer.Location, "namespace name 
expected");
-               else if ((current_namespace.Parent != null) && (name.Left != 
null)) {
-                       Report.Error (134, lexer.Location,
-                                     "Cannot use qualified namespace names in 
nested " +
-                                     "namespace declarations");
-               }
 
                current_namespace = new NamespaceEntry (
                        current_namespace, file, name.GetName (), 
lexer.Location);

Modified: trunk/mcs/gmcs/driver.cs
===================================================================
--- trunk/mcs/gmcs/driver.cs    2005-04-15 08:56:06 UTC (rev 43035)
+++ trunk/mcs/gmcs/driver.cs    2005-04-15 08:56:53 UTC (rev 43036)
@@ -621,17 +621,8 @@
                                Environment.Exit (1);
                        }
                        RootContext.WarningLevel = level;
-                       TestWarningConflict ();
                }
 
-               static void TestWarningConflict ()
-               {
-                       if (RootContext.WarningLevel == 0 && 
Report.WarningsAreErrors) {
-                               Report.Error (1901, "Conflicting options 
specified: Warning level 0; Treat warnings as errors");
-                               Environment.Exit (1);
-                       }
-               }
-
                static void SetupV2 ()
                {
                        RootContext.Version = LanguageVersion.Default;
@@ -814,7 +805,6 @@
                                
                        case "--werror":
                                Report.WarningsAreErrors = true;
-                               TestWarningConflict();
                                return true;
                                
                        case "--nowarn":
@@ -1166,7 +1156,6 @@
                        case "/warnaserror":
                        case "/warnaserror+":
                                Report.WarningsAreErrors = true;
-                               TestWarningConflict();
                                return true;
 
                        case "/warnaserror-":

Modified: trunk/mcs/gmcs/expression.cs
===================================================================
--- trunk/mcs/gmcs/expression.cs        2005-04-15 08:56:06 UTC (rev 43035)
+++ trunk/mcs/gmcs/expression.cs        2005-04-15 08:56:53 UTC (rev 43036)
@@ -7283,13 +7283,6 @@
 
                public override Expression DoResolve (EmitContext ec)
                {
-                       if (!ec.InUnsafe) {
-                               Report.Error (
-                                       233, loc, "Sizeof may only be used in 
an unsafe context " +
-                                       "(consider using 
System.Runtime.InteropServices.Marshal.SizeOf");
-                               return null;
-                       }
-                               
                        TypeExpr texpr = QueriedType.ResolveAsTypeTerminal (ec);
                        if (texpr == null)
                                return null;
@@ -7301,6 +7294,17 @@
 
                        type_queried = texpr.Type;
 
+                       int size_of = GetTypeSize (type_queried);
+                       if (size_of > 0) {
+                               return new IntConstant (size_of);
+                       }
+
+                       if (!ec.InUnsafe) {
+                               Report.Error (233, loc, "'{0}' does not have a 
predefined size, therefore sizeof can only be used in an unsafe context 
(consider using System.Runtime.InteropServices.Marshal.SizeOf)",
+                                        TypeManager.CSharpName (type_queried));
+                               return null;
+                       }
+
                        CheckObsoleteAttribute (type_queried);
 
                        if (!TypeManager.IsUnmanagedType (type_queried)){

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to