From d1d99c84835fc6d75e35212ea98ab38610c4b36c Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Sat, 18 Sep 2010 12:30:15 +0000 Subject: [PATCH] restrict dyn_cast_or_null to pointer types, just like cast_or_null llvm-svn: 114279 --- llvm/include/llvm/Support/Casting.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/include/llvm/Support/Casting.h b/llvm/include/llvm/Support/Casting.h index c589171bbafe..6bb98064382e 100644 --- a/llvm/include/llvm/Support/Casting.h +++ b/llvm/include/llvm/Support/Casting.h @@ -232,8 +232,8 @@ inline typename cast_retty::ret_type dyn_cast(const Y &Val) { // value is accepted. // template -inline typename cast_retty::ret_type dyn_cast_or_null(const Y &Val) { - return (Val && isa(Val)) ? cast(Val) : 0; +inline typename cast_retty::ret_type dyn_cast_or_null(Y *Val) { + return (Val && isa(Val)) ? cast(Val) : 0; } } // End llvm namespace