[cfe-commits] r58252 - /cfe/trunk/test/SemaCXX/return-stack-addr.cpp
Sebastian Redl
sebastian.redl at getdesigned.at
Mon Oct 27 09:34:22 PDT 2008
Author: cornedbee
Date: Mon Oct 27 11:34:21 2008
New Revision: 58252
URL: http://llvm.org/viewvc/llvm-project?rev=58252&view=rev
Log:
Fix some invalid casts that are detected by Sema now or soon.
Modified:
cfe/trunk/test/SemaCXX/return-stack-addr.cpp
Modified: cfe/trunk/test/SemaCXX/return-stack-addr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/return-stack-addr.cpp?rev=58252&r1=58251&r2=58252&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/return-stack-addr.cpp (original)
+++ cfe/trunk/test/SemaCXX/return-stack-addr.cpp Mon Oct 27 11:34:21 2008
@@ -93,15 +93,15 @@
}
-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
}
More information about the cfe-commits
mailing list