From: Daniel Dunbar Date: Fri, 17 Oct 2008 06:22:57 +0000 (+0000) Subject: Anonymous structures print as '?=' in Obj-C type encoding. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=502a4a1ce4c34cf78c8182d9798da0a51d9b7302;p=clang Anonymous structures print as '?=' in Obj-C type encoding. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57674 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 8d9dceb81c..673eb7bf05 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -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) {