// decl.cs: Declaration base class for structs, classes, enums and interfaces.
//
// Author: Miguel de Icaza (miguel@gnu.org)
+// Marek Safar (marek.safar@seznam.cz)
//
// Licensed under the terms of the GNU GPL
//
HasCompliantAttribute_Undetected = 1 << 5, // Presence of CLSCompliantAttribute has not been detected
HasClsCompliantAttribute = 1 << 6, // Type has CLSCompliantAttribute
ClsCompliantAttributeTrue = 1 << 7, // Type has CLSCompliant (true)
+ Excluded_Undetected = 1 << 8, // Conditional attribute has not been detected yet
+ Excluded = 1 << 9 // Method is conditional
+
}
/// <summary>
Name = name.GetName (!(this is GenericMethod) && !(this is Method));
MemberName = name;
Location = loc;
- caching_flags = Flags.Obsolete_Undetected | Flags.ClsCompliance_Undetected | Flags.HasCompliantAttribute_Undetected;
+ caching_flags = Flags.Obsolete_Undetected | Flags.ClsCompliance_Undetected | Flags.HasCompliantAttribute_Undetected | Flags.Excluded_Undetected;
+ }
+
+ /// <summary>
+ /// Tests presence of ObsoleteAttribute and report proper error
+ /// </summary>
+ protected void CheckUsageOfObsoleteAttribute (Type type)
+ {
+ if (type == null)
+ return;
+
+ ObsoleteAttribute obsolete_attr = AttributeTester.GetObsoleteAttribute (type);
+ if (obsolete_attr == null)
+ return;
+
+ AttributeTester.Report_ObsoleteMessage (obsolete_attr, type.FullName, Location);
}
public abstract bool Define (TypeContainer parent);
/// </summary>
public virtual void Emit (TypeContainer container)
{
+ VerifyObsoleteAttribute ();
+
if (!RootContext.VerifyClsCompliance)
return;
return true;
}
+ protected abstract void VerifyObsoleteAttribute ();
+
}
/// <summary>