]> granicus.if.org Git - clang/commitdiff
Anonymous structures print as '?=' in Obj-C type encoding.
authorDaniel Dunbar <daniel@zuster.org>
Fri, 17 Oct 2008 06:22:57 +0000 (06:22 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 17 Oct 2008 06:22:57 +0000 (06:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57674 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTContext.cpp

index 8d9dceb81c6b2a6e0f97a0a3b29c9553b0aa700b..673eb7bf05c7207e1fe0aa261aeb9454a797a550 100644 (file)
@@ -1679,7 +1679,12 @@ void ASTContext::getObjCEncodingForType(QualType T, std::string& S,
     bool inlining = (S.size() == 1 && S[0] == '^' ||
                      S.size() > 1 && S[S.size()-1] != '^');
     S += '{';
-    S += RDecl->getName();
+    // Anonymous structures print as '?'
+    if (const IdentifierInfo *II = RDecl->getIdentifier()) {
+      S += II->getName();
+    } else {
+      S += '?';
+    }
     bool found = false;
     for (unsigned i = 0, e = ERType.size(); i != e; ++i)
       if (ERType[i] == RTy) {