- if (!IsExposedFromAssembly ())
- Report.Warning (3019, 2, Location, "CLS compliance checking will not be performed on `{0}' because it is not visible from outside this assembly", GetSignatureForError ());
- if (!CodeGen.Assembly.IsClsCompliant)
- Report.Warning (3021, 2, Location, "`{0}' does not need a CLSCompliant attribute because the assembly is not marked as CLS-compliant", GetSignatureForError ());
+ if (!IsExposedFromAssembly ()) {
+ Attribute a = OptAttributes.Search (PredefinedAttributes.Get.CLSCompliant);
+ Report.Warning (3019, 2, a.Location, "CLS compliance checking will not be performed on `{0}' because it is not visible from outside this assembly", GetSignatureForError ());
+ }
+
+ if (!CodeGen.Assembly.IsClsCompliant) {
+ Attribute a = OptAttributes.Search (PredefinedAttributes.Get.CLSCompliant);
+ Report.Warning (3021, 2, a.Location, "`{0}' does not need a CLSCompliant attribute because the assembly is not marked as CLS-compliant", GetSignatureForError ());
+ }