See http://msdn.microsoft.com/en-us/library/bhc3fa7f.aspx.
CLS is a specification that one opts-in to. Quote from above:
When you design your own CLS-compliant components, it is helpful to use a CLS-compliant tool. Writing CLS-compliant components without this support is more difficult because otherwise you might not have access to all the CLS features you want to use.
Some CLS-compliant language compilers, such as the C# or Visual Basic compilers, enable you to specify that you intend your code to be CLS-compliant. These compilers can check for CLS compliance and let you know when your code uses functionality that is not supported by the CLS. The C# and Visual Basic compilers allow you to mark a program element as CLS-compliant, which will cause the compiler to generate a compile-time error if the code is not CLS-compliant. For example, the following code generates a compiler warning.
Example code from above link:
using System;
// Assembly marked as compliant.
[assembly: CLSCompliant(true)]
// Class marked as compliant.
[CLSCompliant(true)]
public class MyCompliantClass {
// ChangeValue exposes UInt32, which is not in CLS.
// A compile-time warning results.
public void ChangeValue(UInt32 value){ }
public static void Main( ) {
int i = 2;
Console.WriteLine(i);
}
}
This code generates the following C# warning:
Copy warning CS3001: Argument type 'uint' is not CLS-compliant