Fixes/tweaks that prevent "defaults-i.m" from compiling.
- Allow classnames as the receiver (removing a FIXME from ParseObjCMessageExpression).
- Added a FIXME to ParseObjCMessageExpression()...we need to return a message expr AST node!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42001 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Sema/Sema.h b/Sema/Sema.h
index a6ce9cf..9508653 100644
--- a/Sema/Sema.h
+++ b/Sema/Sema.h
@@ -182,7 +182,7 @@
ScopedDecl *LookupScopedDecl(IdentifierInfo *II, unsigned NSI,
SourceLocation IdLoc, Scope *S);
ScopedDecl *LazilyCreateBuiltin(IdentifierInfo *II, unsigned ID, Scope *S);
- Decl *ImplicitlyDefineFunction(SourceLocation Loc, IdentifierInfo &II,
+ ScopedDecl *ImplicitlyDefineFunction(SourceLocation Loc, IdentifierInfo &II,
Scope *S);
// Decl attributes - this routine is the top level dispatcher.
void HandleDeclAttributes(Decl *New, AttributeList *declspec_prefix,
diff --git a/Sema/SemaDecl.cpp b/Sema/SemaDecl.cpp
index b792b52..16d7213 100644
--- a/Sema/SemaDecl.cpp
+++ b/Sema/SemaDecl.cpp
@@ -815,8 +815,8 @@
/// ImplicitlyDefineFunction - An undeclared identifier was used in a function
/// call, forming a call to an implicitly defined function (per C99 6.5.1p2).
-Decl *Sema::ImplicitlyDefineFunction(SourceLocation Loc, IdentifierInfo &II,
- Scope *S) {
+ScopedDecl *Sema::ImplicitlyDefineFunction(SourceLocation Loc,
+ IdentifierInfo &II, Scope *S) {
if (getLangOptions().C99) // Extension in C99.
Diag(Loc, diag::ext_implicit_function_decl, II.getName());
else // Legal in C90, but warn about it.
@@ -842,7 +842,7 @@
while (S->getParent())
S = S->getParent();
- return static_cast<Decl*>(ActOnDeclarator(S, D, 0));
+ return dyn_cast<ScopedDecl>(static_cast<Decl*>(ActOnDeclarator(S, D, 0)));
}
diff --git a/Sema/SemaExpr.cpp b/Sema/SemaExpr.cpp
index b479c0a..da1981f 100644
--- a/Sema/SemaExpr.cpp
+++ b/Sema/SemaExpr.cpp
@@ -60,7 +60,7 @@
IdentifierInfo &II,
bool HasTrailingLParen) {
// Could be enum-constant or decl.
- Decl *D = LookupScopedDecl(&II, Decl::IDNS_Ordinary, Loc, S);
+ ScopedDecl *D = LookupScopedDecl(&II, Decl::IDNS_Ordinary, Loc, S);
if (D == 0) {
// Otherwise, this could be an implicitly declared function reference (legal
// in C90, extension in C99).