"invalid argument type %0 to unary expression">;
def err_typecheck_indirection_requires_pointer : Error<
"indirection requires pointer operand (%0 invalid)">;
-def ext_typecheck_indirection_through_void_pointer : Extension<
+def ext_typecheck_indirection_through_void_pointer : ExtWarn<
"ISO C++ does not allow indirection on operand of type %0">,
InGroup<DiagGroup<"void-ptr-dereference">>;
def warn_indirection_through_null : Warning<
template<typename T, typename U>
void X0<T, U>::f(T *t, const U &u) {
- *t = u; // expected-error{{not assignable}}
+ *t = u; // expected-warning{{indirection on operand of type 'void *'}} expected-error{{not assignable}}
}
void test_f(X0<float, int> xfi, X0<void, int> xvi, float *fp, void *vp, int i) {
(void)*reinterpret_cast<float*>(v_ptr);
// Casting to void pointer
- (void)*reinterpret_cast<void*>(&a);
- (void)*reinterpret_cast<void*>(&b);
- (void)*reinterpret_cast<void*>(&l);
- (void)*reinterpret_cast<void*>(&d);
- (void)*reinterpret_cast<void*>(&f);
+ (void)*reinterpret_cast<void*>(&a); // expected-warning {{ISO C++ does not allow}}
+ (void)*reinterpret_cast<void*>(&b); // expected-warning {{ISO C++ does not allow}}
+ (void)*reinterpret_cast<void*>(&l); // expected-warning {{ISO C++ does not allow}}
+ (void)*reinterpret_cast<void*>(&d); // expected-warning {{ISO C++ does not allow}}
+ (void)*reinterpret_cast<void*>(&f); // expected-warning {{ISO C++ does not allow}}
}
void reinterpret_cast_whitelist () {