def warn_void_pointer_to_enum_cast : Warning<
warn_void_pointer_to_int_cast.Text>,
InGroup<VoidPointerToEnumCast>;
-def ext_ms_pointer_to_int_cast : ExtWarn<
- "cast to smaller integer type %1 from %0 is a Microsoft extension">,
-InGroup<MicrosoftCast>;
def warn_attribute_ignored_for_field_of_type : Warning<
"%0 attribute ignored for field of type %1">,
// is undefined. The result need not be in the range of values of any
// integer type.
unsigned Diag;
- if (Self.getLangOpts().MicrosoftExt)
- Diag = diag::ext_ms_pointer_to_int_cast;
- else if (SrcType->isVoidPointerType())
+ if (SrcType->isVoidPointerType())
Diag = DestType->isEnumeralType() ? diag::warn_void_pointer_to_enum_cast
: diag::warn_void_pointer_to_int_cast;
else if (DestType->isEnumeralType())
-// RUN: %clang_cc1 -triple i686-windows %s -fsyntax-only -Wno-unused-value -Wmicrosoft -verify -fms-extensions
-
+// RUN: %clang_cc1 -triple i686-windows %s -fsyntax-only -Wno-unused-value -Wno-pointer-to-int-cast -Wmicrosoft -verify -fms-extensions
struct A
{
};
void pointer_to_integral_type_conv(char* ptr) {
- char ch = (char)ptr; // expected-warning{{cast to smaller integer type 'char' from 'char *' is a Microsoft extension}}
- short sh = (short)ptr; // expected-warning{{cast to smaller integer type 'short' from 'char *' is a Microsoft extension}}
- ch = (char)ptr; // expected-warning{{cast to smaller integer type 'char' from 'char *' is a Microsoft extension}}
- sh = (short)ptr; // expected-warning{{cast to smaller integer type 'short' from 'char *' is a Microsoft extension}}
+ char ch = (char)ptr;
+ short sh = (short)ptr;
+ ch = (char)ptr;
+ sh = (short)ptr;
- // This is valid ISO C.
- _Bool b = (_Bool)ptr;
+ // This is valid ISO C.
+ _Bool b = (_Bool)ptr;
}
typedef struct {