Pass the DeclName to the diagnostic builder so that member names will be quoted correctly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75150 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index 72adcc2..5b22bb7 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -1989,13 +1989,13 @@
}
else if (FieldType->isReferenceType()) {
Diag(CurrentLocation, diag::err_unintialized_member)
- << Context.getTagDeclType(ClassDecl) << 0 << (*Field)->getNameAsCString();
+ << Context.getTagDeclType(ClassDecl) << 0 << Field->getDeclName();
Diag((*Field)->getLocation(), diag::note_declared_at);
err = true;
}
else if (FieldType.isConstQualified()) {
Diag(CurrentLocation, diag::err_unintialized_member)
- << Context.getTagDeclType(ClassDecl) << 1 << (*Field)->getNameAsCString();
+ << Context.getTagDeclType(ClassDecl) << 1 << Field->getDeclName();
Diag((*Field)->getLocation(), diag::note_declared_at);
err = true;
}