if (!castType->isScalarType() && !castType->isVectorType()) {
// GCC struct/union extension.
if (castType == castExpr->getType() &&
- castType->isStructureType() || castType->isUnionType())
- return Diag(LParenLoc, diag::ext_typecheck_cast_nonscalar,
- SourceRange(LParenLoc, RParenLoc));
- else
+ castType->isStructureType() || castType->isUnionType()) {
+ Diag(LParenLoc, diag::ext_typecheck_cast_nonscalar,
+ SourceRange(LParenLoc, RParenLoc));
+ return new CastExpr(castType, castExpr, LParenLoc);
+ } else
return Diag(LParenLoc, diag::err_typecheck_cond_expect_scalar,
castType.getAsString(), SourceRange(LParenLoc, RParenLoc));
}
--- /dev/null
+// RUN: clang %s -verify -fms-extensions
+@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
+typedef struct _NSRange { } NSRange;
+
+@class PBXFileReference;
+
+@interface PBXDocBookmark
++ alloc;
+- autorelease;
+@end
+@implementation PBXDocBookmark // expected-warning {{incomplete implementation}} expected-warning {{method definition for 'autorelease' not found}} expected-warning {{method definition for 'alloc' not found}}
+
++ (id)bookmarkWithFileReference:(PBXFileReference *)fileRef gylphRange:(NSRange)range anchor:(NSString *)htmlAnchor
+{
+ NSRange r = (NSRange)range;
+ return [[[self alloc] initWithFileReference:fileRef gylphRange:(NSRange)range anchor:(NSString *)htmlAnchor] autorelease]; // expected-warning {{method '-initWithFileReference:gylphRange:anchor:' not found (return type defaults to 'id')}}
+}
+@end