]> granicus.if.org Git - clang/commitdiff
Fix for PR5706: let mangleName deal with mangling names without identifiers
authorEli Friedman <eli.friedman@gmail.com>
Fri, 11 Dec 2009 18:00:57 +0000 (18:00 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Fri, 11 Dec 2009 18:00:57 +0000 (18:00 +0000)
correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91136 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/Mangle.cpp
test/CodeGenCXX/mangle.cpp

index d156ba549ee0be06a896d5a17c014d4bcab72bfc..57f125e33669c04d8095acda03f84fe2bf4d17c9 100644 (file)
@@ -877,10 +877,7 @@ void CXXNameMangler::mangleType(const RecordType *T) {
   mangleType(static_cast<const TagType*>(T));
 }
 void CXXNameMangler::mangleType(const TagType *T) {
-  if (!T->getDecl()->getIdentifier())
-    mangleName(T->getDecl()->getTypedefForAnonDecl());
-  else
-    mangleName(T->getDecl());
+  mangleName(T->getDecl());
 }
 
 // <type>       ::= <array-type>
index 38f3c8bd3fb364ff8ee297e8dd260976249566cf..a2e92e9738d757fb8bd4ae5500862fa09c995574 100644 (file)
@@ -228,3 +228,11 @@ template<typename T> typename __enable_if<(__is_scalar<T>::__value), void>::__ty
 template void ft8<int>();
 // CHECK: @_Z3ft8IPvEN11__enable_ifIXsr11__is_scalarIT_E7__valueEvE6__typeEv
 template void ft8<void*>();
+
+// PR5706
+// This example was crashing in the mangler code
+struct S8 {
+  virtual ~S8() { }
+};
+
+static struct : S8 { } obj8;