]> granicus.if.org Git - clang/commitdiff
Fix some invalid casts that are detected by Sema now or soon.
authorSebastian Redl <sebastian.redl@getdesigned.at>
Mon, 27 Oct 2008 16:34:21 +0000 (16:34 +0000)
committerSebastian Redl <sebastian.redl@getdesigned.at>
Mon, 27 Oct 2008 16:34:21 +0000 (16:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58252 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaCXX/return-stack-addr.cpp

index c7d1a7f3d6b198a75ffa6990a06ea57d1b7b9d88..da68c8d77a4ca099fb216793fea0d929271bdc77 100644 (file)
@@ -93,15 +93,15 @@ int* ret_parameter(int x) {
 }
 
 
-int* ret_cpp_static_cast(short x) {
-  return static_cast<int*>(&x); // expected-warning {{address of stack memory}}
+void* ret_cpp_static_cast(short x) {
+  return static_cast<void*>(&x); // expected-warning {{address of stack memory}}
 }
 
 int* ret_cpp_reinterpret_cast(double x) {
   return reinterpret_cast<int*>(&x); // expected-warning {{address of stack me}}
 }
 
-int* ret_cpp_reinterpret_cast_no_warning(double x) {
+int* ret_cpp_reinterpret_cast_no_warning(long x) {
   return reinterpret_cast<int*>(x); // no-warning
 }