From: Richard Smith Date: Tue, 19 May 2015 01:41:12 +0000 (+0000) Subject: PR20073: promote "dereference of 'void*'" from Extension to ExtWarn. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1bc417d4e8080809de1920922fd97131f940986d;p=clang PR20073: promote "dereference of 'void*'" from Extension to ExtWarn. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237652 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 02be44639b..2f41921578 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -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>; def warn_indirection_through_null : Warning< diff --git a/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1inst.cpp b/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1inst.cpp index f09faa90d5..eb11e3375e 100644 --- a/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1inst.cpp +++ b/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1inst.cpp @@ -8,7 +8,7 @@ struct X0 { template void X0::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 xfi, X0 xvi, float *fp, void *vp, int i) { diff --git a/test/SemaCXX/reinterpret-cast.cpp b/test/SemaCXX/reinterpret-cast.cpp index 4284032d9b..7c88dc0302 100644 --- a/test/SemaCXX/reinterpret-cast.cpp +++ b/test/SemaCXX/reinterpret-cast.cpp @@ -201,11 +201,11 @@ void dereference_reinterpret_cast() { (void)*reinterpret_cast(v_ptr); // Casting to void pointer - (void)*reinterpret_cast(&a); - (void)*reinterpret_cast(&b); - (void)*reinterpret_cast(&l); - (void)*reinterpret_cast(&d); - (void)*reinterpret_cast(&f); + (void)*reinterpret_cast(&a); // expected-warning {{ISO C++ does not allow}} + (void)*reinterpret_cast(&b); // expected-warning {{ISO C++ does not allow}} + (void)*reinterpret_cast(&l); // expected-warning {{ISO C++ does not allow}} + (void)*reinterpret_cast(&d); // expected-warning {{ISO C++ does not allow}} + (void)*reinterpret_cast(&f); // expected-warning {{ISO C++ does not allow}} } void reinterpret_cast_whitelist () {