[cfe-commits] r120902 - /cfe/trunk/lib/Sema/SemaExprCXX.cpp

John McCall rjmccall at apple.com
Sat Dec 4 01:57:16 PST 2010


Author: rjmccall
Date: Sat Dec  4 03:57:16 2010
New Revision: 120902

URL: http://llvm.org/viewvc/llvm-project?rev=120902&view=rev
Log:
dyn_cast else unreachable -> cast


Modified:
    cfe/trunk/lib/Sema/SemaExprCXX.cpp

Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=120902&r1=120901&r2=120902&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Sat Dec  4 03:57:16 2010
@@ -1719,8 +1719,8 @@
         // the initial standard conversion sequence converts the source type to
         // the implicit object parameter of the conversion function.
         BeforeToType = Context.getTagDeclType(Conv->getParent());
-      } else if (const CXXConstructorDecl *Ctor = 
-                  dyn_cast<CXXConstructorDecl>(FD)) {
+      } else {
+        const CXXConstructorDecl *Ctor = cast<CXXConstructorDecl>(FD);
         CastKind = CK_ConstructorConversion;
         // Do no conversion if dealing with ... for the first conversion.
         if (!ICS.UserDefined.EllipsisConversion) {
@@ -1730,8 +1730,6 @@
           BeforeToType = Ctor->getParamDecl(0)->getType().getNonReferenceType();
         }
       }    
-      else
-        assert(0 && "Unknown conversion function kind!");
       // Watch out for elipsis conversion.
       if (!ICS.UserDefined.EllipsisConversion) {
         if (PerformImplicitConversion(From, BeforeToType, 





More information about the cfe-commits mailing list