IsCompleteDefinitionRequired = V;
}
- // FIXME: Return StringRef;
- const char *getKindName() const {
+ StringRef getKindName() const {
return TypeWithKeyword::getTagTypeKindName(getTagKind());
}
static bool KeywordIsTagTypeKind(ElaboratedTypeKeyword Keyword);
- static const char *getKeywordName(ElaboratedTypeKeyword Keyword);
+ static StringRef getKeywordName(ElaboratedTypeKeyword Keyword);
- static const char *getTagTypeKindName(TagTypeKind Kind) {
+ static StringRef getTagTypeKindName(TagTypeKind Kind) {
return getKeywordName(getKeywordForTagTypeKind(Kind));
}
llvm_unreachable("Unknown elaborated type keyword.");
}
-const char*
-TypeWithKeyword::getKeywordName(ElaboratedTypeKeyword Keyword) {
+StringRef TypeWithKeyword::getKeywordName(ElaboratedTypeKeyword Keyword) {
switch (Keyword) {
case ETK_None: return "";
case ETK_Typename: return "typename";
// a tag in front.
if (const RecordType *RT = T->getAs<RecordType>()) {
RecordDecl *RD = RT->getDecl();
-
- std::string InsertionText = std::string(" ") + RD->getKindName();
-
+
+ SmallString<16> InsertionText(" ");
+ InsertionText += RD->getKindName();
+
Diag(TypeRange.getBegin(),
getLangOpts().CPlusPlus11 ?
diag::warn_cxx98_compat_unelaborated_friend_type :