summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/ASTContext.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 8d9dceb81c6..673eb7bf05c 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/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) {
OpenPOWER on IntegriCloud