r237652 - PR20073: promote "dereference of 'void*'" from Extension to ExtWarn.
Richard Smith
richard-llvm at metafoo.co.uk
Mon May 18 18:41:13 PDT 2015
Author: rsmith
Date: Mon May 18 20:41:12 2015
New Revision: 237652
URL: http://llvm.org/viewvc/llvm-project?rev=237652&view=rev
Log:
PR20073: promote "dereference of 'void*'" from Extension to ExtWarn.
Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1inst.cpp
cfe/trunk/test/SemaCXX/reinterpret-cast.cpp
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=237652&r1=237651&r2=237652&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Mon May 18 20:41:12 2015
@@ -5030,7 +5030,7 @@ def err_typecheck_unary_expr : Error<
"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<
Modified: cfe/trunk/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1inst.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1inst.cpp?rev=237652&r1=237651&r2=237652&view=diff
==============================================================================
--- cfe/trunk/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1inst.cpp (original)
+++ cfe/trunk/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1inst.cpp Mon May 18 20:41:12 2015
@@ -8,7 +8,7 @@ struct X0 {
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) {
Modified: cfe/trunk/test/SemaCXX/reinterpret-cast.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/reinterpret-cast.cpp?rev=237652&r1=237651&r2=237652&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/reinterpret-cast.cpp (original)
+++ cfe/trunk/test/SemaCXX/reinterpret-cast.cpp Mon May 18 20:41:12 2015
@@ -201,11 +201,11 @@ void dereference_reinterpret_cast() {
(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 () {
More information about the cfe-commits
mailing list