Eliminate all of the placeholder identifiers used for constructors,
destructors, and conversion functions. The placeholders were used to
work around the fact that the parser and some of Sema really wanted
declarators to have simple identifiers; now, the code that deals with
declarators will use DeclarationNames.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59469 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index 2df6073..f601fe4 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -421,7 +421,7 @@
ExprTy *BW, ExprTy *InitExpr,
DeclTy *LastInGroup) {
const DeclSpec &DS = D.getDeclSpec();
- IdentifierInfo *II = D.getIdentifier();
+ DeclarationName Name = GetNameForDeclarator(D);
Expr *BitWidth = static_cast<Expr*>(BW);
Expr *Init = static_cast<Expr*>(InitExpr);
SourceLocation Loc = D.getIdentifierLoc();
@@ -499,7 +499,7 @@
if (!Member) return LastInGroup;
- assert((II || isInstField) && "No identifier for non-field ?");
+ assert((Name || isInstField) && "No identifier for non-field ?");
// set/getAccess is not part of Decl's interface to avoid bloating it with C++
// specific methods. Use a wrapper class that can be used with all C++ class
@@ -532,14 +532,14 @@
// FIXME: Emit diagnostic about only constructors taking base initializers
// or something similar, when constructor support is in place.
Diag(Loc, diag::err_not_bitfield_type,
- II->getName(), BitWidth->getSourceRange());
+ Name.getAsString(), BitWidth->getSourceRange());
InvalidDecl = true;
} else if (isInstField) {
// C++ 9.6p3: A bit-field shall have integral or enumeration type.
if (!cast<FieldDecl>(Member)->getType()->isIntegralType()) {
Diag(Loc, diag::err_not_integral_type_bitfield,
- II->getName(), BitWidth->getSourceRange());
+ Name.getAsString(), BitWidth->getSourceRange());
InvalidDecl = true;
}
@@ -547,12 +547,12 @@
// A function typedef ("typedef int f(); f a;").
// C++ 9.6p3: A bit-field shall have integral or enumeration type.
Diag(Loc, diag::err_not_integral_type_bitfield,
- II->getName(), BitWidth->getSourceRange());
+ Name.getAsString(), BitWidth->getSourceRange());
InvalidDecl = true;
} else if (isa<TypedefDecl>(Member)) {
// "cannot declare 'A' to be a bit-field type"
- Diag(Loc, diag::err_not_bitfield_type, II->getName(),
+ Diag(Loc, diag::err_not_bitfield_type, Name.getAsString(),
BitWidth->getSourceRange());
InvalidDecl = true;
@@ -561,7 +561,7 @@
"Didn't we cover all member kinds?");
// C++ 9.6p3: A bit-field shall not be a static member.
// "static member 'A' cannot be a bit-field"
- Diag(Loc, diag::err_static_not_bitfield, II->getName(),
+ Diag(Loc, diag::err_static_not_bitfield, Name.getAsString(),
BitWidth->getSourceRange());
InvalidDecl = true;
}
@@ -584,14 +584,14 @@
} else {
// not const integral.
Diag(Loc, diag::err_member_initialization,
- II->getName(), Init->getSourceRange());
+ Name.getAsString(), Init->getSourceRange());
InvalidDecl = true;
}
} else {
// not static member.
Diag(Loc, diag::err_member_initialization,
- II->getName(), Init->getSourceRange());
+ Name.getAsString(), Init->getSourceRange());
InvalidDecl = true;
}
}