Add -Wcustom-atomic-properties which warns if an atomic-by-default property has custom getter or setter.

The rationale is that it is highly likely that the user's getter/setter isn't atomically implemented. Off by default.
Addresses rdar://8782645.

-Wcustom-atomic-properties and -Wimplicit-atomic-properties are under the -Watomic-properties group.

llvm-svn: 124609
diff --git a/clang/test/SemaObjC/custom-atomic-property.m b/clang/test/SemaObjC/custom-atomic-property.m
new file mode 100644
index 0000000..cf3d473
--- /dev/null
+++ b/clang/test/SemaObjC/custom-atomic-property.m
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1  -fsyntax-only -Wcustom-atomic-properties -verify %s
+
+@interface Foo
+@property (assign) Foo *myProp; // expected-note {{property declared here}} expected-note {{property declared here}}
+@end
+
+@implementation Foo
+ -(Foo*)myProp {return 0;} // expected-warning {{atomic by default property 'myProp' has a user defined setter/getter (property should be marked 'atomic' if this is intended)}}
+ -(void)setMyProp:(Foo*)e {} // expected-warning {{atomic by default property 'myProp' has a user defined setter/getter (property should be marked 'atomic' if this is intended)}}
+@end