Apparently empty names are allowed here.

llvm-svn: 157117
This commit is contained in:
Benjamin Kramer 2012-05-19 16:34:46 +00:00
parent 1458c1c009
commit 365082dbfa
2 changed files with 6 additions and 4 deletions

View File

@ -1504,15 +1504,16 @@ Sema::ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, Declarator &D,
Decl *Member;
if (isInstField) {
CXXScopeSpec &SS = D.getCXXScopeSpec();
IdentifierInfo *II = Name.getAsIdentifierInfo();
// Data members must have identifiers for names.
if (!II) {
if (!Name.isIdentifier()) {
Diag(Loc, diag::err_bad_variable_name)
<< Name;
return 0;
}
IdentifierInfo *II = Name.getAsIdentifierInfo();
// Member field could not be with "template" keyword.
// So TemplateParameterLists should be empty in this case.
if (TemplateParameterLists.size()) {

View File

@ -1399,12 +1399,13 @@ HandleExprPropertyRefExpr(const ObjCObjectPointerType *OPT,
const ObjCInterfaceType *IFaceT = OPT->getInterfaceType();
ObjCInterfaceDecl *IFace = IFaceT->getDecl();
IdentifierInfo *Member = MemberName.getAsIdentifierInfo();
if (!Member) {
if (!MemberName.isIdentifier()) {
Diag(MemberLoc, diag::err_invalid_property_name)
<< MemberName << QualType(OPT, 0);
return ExprError();
}
IdentifierInfo *Member = MemberName.getAsIdentifierInfo();
SourceRange BaseRange = Super? SourceRange(SuperLoc)
: BaseExpr->getSourceRange();