[cfe-commits] r71907 - in /cfe/trunk: include/clang/AST/Expr.h lib/AST/Expr.cpp lib/Sema/SemaExpr.cpp test/SemaTemplate/instantiate-function-1.cpp
Eli Friedman
eli.friedman at gmail.com
Fri May 15 17:10:07 PDT 2009
On Fri, May 15, 2009 at 4:10 PM, Anders Carlsson <andersca at mac.com> wrote:
> @@ -2033,6 +2036,17 @@
> return ExprError(Diag(MemberLoc,
> diag::err_typecheck_member_reference_arrow)
> << BaseType << BaseExpr->getSourceRange());
> + } else {
> + // We use isTemplateTypeParmType directly here, instead of simply checking
> + // whether BaseType is dependent, because we want to report an error for
> + //
> + // T *t;
> + // t.foo;
> + //
> + //
> + if (BaseType->isTemplateTypeParmType())
> + return Owned(new (Context) MemberExpr(BaseExpr, false, 0,
> + MemberLoc, Context.DependentTy));
> }
>
> // Handle field access to simple records. This also handles access to fields
I think the example you give isn't necessarily an error in ObjC++
(suppose T is an ObjC interface, and foo is a property of T).
Also, I think you missed a check for BuiltinType::Dependent.
-Eli
More information about the cfe-commits
mailing list