[llvm-commits] [llvm] r114279 - /llvm/trunk/include/llvm/Support/Casting.h
Gabor Greif
ggreif at gmail.com
Sat Sep 18 05:30:15 PDT 2010
Author: ggreif
Date: Sat Sep 18 07:30:15 2010
New Revision: 114279
URL: http://llvm.org/viewvc/llvm-project?rev=114279&view=rev
Log:
restrict dyn_cast_or_null to pointer types, just like cast_or_null
Modified:
llvm/trunk/include/llvm/Support/Casting.h
Modified: llvm/trunk/include/llvm/Support/Casting.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Casting.h?rev=114279&r1=114278&r2=114279&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Casting.h (original)
+++ llvm/trunk/include/llvm/Support/Casting.h Sat Sep 18 07:30:15 2010
@@ -232,8 +232,8 @@
// value is accepted.
//
template <class X, class Y>
-inline typename cast_retty<X, Y>::ret_type dyn_cast_or_null(const Y &Val) {
- return (Val && isa<X>(Val)) ? cast<X, Y>(Val) : 0;
+inline typename cast_retty<X, Y*>::ret_type dyn_cast_or_null(Y *Val) {
+ return (Val && isa<X>(Val)) ? cast<X>(Val) : 0;
}
} // End llvm namespace
More information about the llvm-commits
mailing list