Author: marek
Date: 2005-03-08 06:53:54 -0500 (Tue, 08 Mar 2005)
New Revision: 41561
Modified:
trunk/mcs/mcs/ChangeLog
trunk/mcs/mcs/cs-parser.jay
trunk/mcs/mcs/driver.cs
trunk/mcs/mcs/expression.cs
Log:
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.
Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog 2005-03-08 11:45:11 UTC (rev 41560)
+++ trunk/mcs/mcs/ChangeLog 2005-03-08 11:53:54 UTC (rev 41561)
@@ -1,3 +1,12 @@
+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
Modified: trunk/mcs/mcs/cs-parser.jay
===================================================================
--- trunk/mcs/mcs/cs-parser.jay 2005-03-08 11:45:11 UTC (rev 41560)
+++ trunk/mcs/mcs/cs-parser.jay 2005-03-08 11:53:54 UTC (rev 41561)
@@ -364,12 +364,6 @@
MemberName name = (MemberName) $3;
- 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/mcs/driver.cs
===================================================================
--- trunk/mcs/mcs/driver.cs 2005-03-08 11:45:11 UTC (rev 41560)
+++ trunk/mcs/mcs/driver.cs 2005-03-08 11:53:54 UTC (rev 41561)
@@ -619,17 +619,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;
@@ -812,7 +803,6 @@
case "--werror":
Report.WarningsAreErrors = true;
- TestWarningConflict();
return true;
case "--nowarn":
@@ -1164,7 +1154,6 @@
case "/warnaserror":
case "/warnaserror+":
Report.WarningsAreErrors = true;
- TestWarningConflict();
return true;
case "/warnaserror-":
Modified: trunk/mcs/mcs/expression.cs
===================================================================
--- trunk/mcs/mcs/expression.cs 2005-03-08 11:45:11 UTC (rev 41560)
+++ trunk/mcs/mcs/expression.cs 2005-03-08 11:53:54 UTC (rev 41561)
@@ -7125,19 +7125,23 @@
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,
false);
if (texpr == null)
return null;
type_queried = texpr.ResolveType (ec);
+ 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