From: Chris Lattner Date: Tue, 21 Apr 2009 23:00:09 +0000 (+0000) Subject: fix PR4026: Clang can't codegen __func__ without implicit cast X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f0a990c2aa0b596a7e3cdd8fa2a5909d591ffe66;p=clang fix PR4026: Clang can't codegen __func__ without implicit cast git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69747 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp index 9d6df5c820..2e45f2017b 100644 --- a/lib/CodeGen/CGExprAgg.cpp +++ b/lib/CodeGen/CGExprAgg.cpp @@ -64,16 +64,19 @@ public: void VisitMemberExpr(MemberExpr *ME) { EmitAggLoadOfLValue(ME); } void VisitUnaryDeref(UnaryOperator *E) { EmitAggLoadOfLValue(E); } void VisitStringLiteral(StringLiteral *E) { EmitAggLoadOfLValue(E); } - void VisitCompoundLiteralExpr(CompoundLiteralExpr *E) - { EmitAggLoadOfLValue(E); } - + void VisitCompoundLiteralExpr(CompoundLiteralExpr *E) { + EmitAggLoadOfLValue(E); + } void VisitArraySubscriptExpr(ArraySubscriptExpr *E) { EmitAggLoadOfLValue(E); } + void VisitBlockDeclRefExpr(const BlockDeclRefExpr *E) { + EmitAggLoadOfLValue(E); + } + void VisitPredefinedExpr(const PredefinedExpr *E) { + EmitAggLoadOfLValue(E); + } - void VisitBlockDeclRefExpr(const BlockDeclRefExpr *E) - { EmitAggLoadOfLValue(E); } - // Operators. // case Expr::UnaryOperatorClass: // case Expr::CastExprClass: diff --git a/test/CodeGen/exprs.c b/test/CodeGen/exprs.c index 0e74b8c773..f80ee41958 100644 --- a/test/CodeGen/exprs.c +++ b/test/CodeGen/exprs.c @@ -94,3 +94,8 @@ struct s6 { int f0; }; int f6(int a0, struct s6 a1, struct s6 a2) { return (a0 ? a1 : a2).f0; } + +// PR4026 +void f7() { + __func__; +}