[cfe-commits] r157117 - in /cfe/trunk/lib/Sema: SemaDeclCXX.cpp SemaExprObjC.cpp
Benjamin Kramer
benny.kra at googlemail.com
Sat May 19 09:34:46 PDT 2012
Author: d0k
Date: Sat May 19 11:34:46 2012
New Revision: 157117
URL: http://llvm.org/viewvc/llvm-project?rev=157117&view=rev
Log:
Apparently empty names are allowed here.
Modified:
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
cfe/trunk/lib/Sema/SemaExprObjC.cpp
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=157117&r1=157116&r2=157117&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Sat May 19 11:34:46 2012
@@ -1504,15 +1504,16 @@
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()) {
Modified: cfe/trunk/lib/Sema/SemaExprObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprObjC.cpp?rev=157117&r1=157116&r2=157117&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprObjC.cpp Sat May 19 11:34:46 2012
@@ -1399,12 +1399,13 @@
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();
More information about the cfe-commits
mailing list