Author: martin
Date: 2006-06-21 13:06:56 -0400 (Wed, 21 Jun 2006)
New Revision: 61912
Removed:
trunk/mcs/tests/test-anon-26.cs
Modified:
trunk/mcs/gmcs/ChangeLog
trunk/mcs/gmcs/expression.cs
trunk/mcs/mcs/ChangeLog
trunk/mcs/mcs/expression.cs
trunk/mcs/tests/ChangeLog
Log:
2006-06-21 Martin Baulig <[EMAIL PROTECTED]>
* expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
also report CS1686 for parameters.
Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog 2006-06-21 15:57:26 UTC (rev 61911)
+++ trunk/mcs/gmcs/ChangeLog 2006-06-21 17:06:56 UTC (rev 61912)
@@ -1,5 +1,10 @@
2006-06-21 Martin Baulig <[EMAIL PROTECTED]>
+ * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
+ also report CS1686 for parameters.
+
+2006-06-21 Martin Baulig <[EMAIL PROTECTED]>
+
* statement.cs (GotoCase.Resolve): Report a warning (CS0469)
instead of an error if the value is not implicitly convertible to
the switch types; fixes #77964.
Modified: trunk/mcs/gmcs/expression.cs
===================================================================
--- trunk/mcs/gmcs/expression.cs 2006-06-21 15:57:26 UTC (rev 61911)
+++ trunk/mcs/gmcs/expression.cs 2006-06-21 17:06:56 UTC (rev 61912)
@@ -456,6 +456,13 @@
lr.local_info.Used = true;
}
+ ParameterReference pr = Expr as
ParameterReference;
+ if ((pr != null) && (ec.capture_context !=
null) &&
+ ec.capture_context.IsParameterCaptured
(pr.Name)) {
+
AnonymousMethod.Error_AddressOfCapturedVar (pr.Name, loc);
+ return null;
+ }
+
// According to the specs, a variable is
considered definitely assigned if you take
// its address.
if ((variable != null) &&
(variable.VariableInfo != null)){
@@ -3548,6 +3555,12 @@
}
}
+ public string Name {
+ get {
+ return name;
+ }
+ }
+
LocalTemporary temp;
public ParameterReference (Parameter par, Block block, int idx,
Location loc)
Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog 2006-06-21 15:57:26 UTC (rev 61911)
+++ trunk/mcs/mcs/ChangeLog 2006-06-21 17:06:56 UTC (rev 61912)
@@ -1,5 +1,10 @@
2006-06-21 Martin Baulig <[EMAIL PROTECTED]>
+ * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
+ also report CS1686 for parameters.
+
+2006-06-21 Martin Baulig <[EMAIL PROTECTED]>
+
* statement.cs (GotoCase.Resolve): Report a warning (CS0469)
instead of an error if the value is not implicitly convertible to
the switch types; fixes #77964.
Modified: trunk/mcs/mcs/expression.cs
===================================================================
--- trunk/mcs/mcs/expression.cs 2006-06-21 15:57:26 UTC (rev 61911)
+++ trunk/mcs/mcs/expression.cs 2006-06-21 17:06:56 UTC (rev 61912)
@@ -456,6 +456,13 @@
lr.local_info.Used = true;
}
+ ParameterReference pr = Expr as
ParameterReference;
+ if ((pr != null) && (ec.capture_context !=
null) &&
+ ec.capture_context.IsParameterCaptured
(pr.Name)) {
+
AnonymousMethod.Error_AddressOfCapturedVar (pr.Name, loc);
+ return null;
+ }
+
// According to the specs, a variable is
considered definitely assigned if you take
// its address.
if ((variable != null) &&
(variable.VariableInfo != null)){
@@ -3455,6 +3462,12 @@
}
}
+ public string Name {
+ get {
+ return name;
+ }
+ }
+
LocalTemporary temp;
public ParameterReference (Parameter par, Block block, int idx,
Location loc)
Modified: trunk/mcs/tests/ChangeLog
===================================================================
--- trunk/mcs/tests/ChangeLog 2006-06-21 15:57:26 UTC (rev 61911)
+++ trunk/mcs/tests/ChangeLog 2006-06-21 17:06:56 UTC (rev 61912)
@@ -1,5 +1,10 @@
2006-06-21 Martin Baulig <[EMAIL PROTECTED]>
+ * test-anon-26.cs: Removed - this test case must not compile;
+ and we're now correctly reporting the CS1686.
+
+2006-06-21 Martin Baulig <[EMAIL PROTECTED]>
+
* test-49.cs: Add test case for #77964.
2006-06-16 Raja R Harinath <[EMAIL PROTECTED]>
Deleted: trunk/mcs/tests/test-anon-26.cs
===================================================================
--- trunk/mcs/tests/test-anon-26.cs 2006-06-21 15:57:26 UTC (rev 61911)
+++ trunk/mcs/tests/test-anon-26.cs 2006-06-21 17:06:56 UTC (rev 61912)
@@ -1,28 +0,0 @@
-// Compiler options: -unsafe
-using System;
-
-delegate int D ();
-
-unsafe class X {
-
- static int Main ()
- {
- D x = T (1);
-
- int v = x ();
- Console.WriteLine ("Should be 2={0}", v);
- return v == 2 ? 0 : 1;
- }
-
- static D T (int a)
- {
- D d = delegate {
- int *x = &a;
-
- *x = *x + 1;
- return *x;
- };
-
- return d;
- }
-}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches