]> granicus.if.org Git - clang/commitdiff
assert that mangleName is not called for C++ ctors/dtors.
authorAnders Carlsson <andersca@mac.com>
Sun, 3 May 2009 16:51:04 +0000 (16:51 +0000)
committerAnders Carlsson <andersca@mac.com>
Sun, 3 May 2009 16:51:04 +0000 (16:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70783 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/Mangle.cpp

index e6d643f7ca8b33d2c95bc5c4e68077f8df8ab182..b61acbbe5191573adf6069a3da700a939ec274b1 100644 (file)
@@ -657,6 +657,11 @@ namespace clang {
   /// (\c D->getIdentifier()) as its name.
   bool mangleName(const NamedDecl *D, ASTContext &Context, 
                   llvm::raw_ostream &os) {
+    assert(!isa<CXXConstructorDecl>(D) &&
+           "Use mangleCXXCtor for constructor decls!");
+    assert(!isa<CXXDestructorDecl>(D) &&
+           "Use mangleCXXDtor for destructor decls!");
+    
     CXXNameMangler Mangler(Context, os);
     if (!Mangler.mangle(D))
       return false;