[cfe-commits] r88735 - in /cfe/trunk: lib/CodeGen/CGExpr.cpp test/CodeGenCXX/default-arguments.cpp
Anders Carlsson
andersca at mac.com
Fri Nov 13 17:51:51 PST 2009
Author: andersca
Date: Fri Nov 13 19:51:50 2009
New Revision: 88735
URL: http://llvm.org/viewvc/llvm-project?rev=88735&view=rev
Log:
Handle CXXDefaultArgExprs in EmitLValue. Fixes PR5484.
Added:
cfe/trunk/test/CodeGenCXX/default-arguments.cpp
Modified:
cfe/trunk/lib/CodeGen/CGExpr.cpp
Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=88735&r1=88734&r2=88735&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Fri Nov 13 19:51:50 2009
@@ -267,6 +267,10 @@
return EmitCXXBindTemporaryLValue(cast<CXXBindTemporaryExpr>(E));
case Expr::CXXExprWithTemporariesClass:
return EmitCXXExprWithTemporariesLValue(cast<CXXExprWithTemporaries>(E));
+ case Expr::CXXZeroInitValueExprClass:
+ return EmitNullInitializationLValue(cast<CXXZeroInitValueExpr>(E));
+ case Expr::CXXDefaultArgExprClass:
+ return EmitLValue(cast<CXXDefaultArgExpr>(E)->getExpr());
case Expr::ObjCMessageExprClass:
return EmitObjCMessageExprLValue(cast<ObjCMessageExpr>(E));
@@ -303,8 +307,6 @@
case Expr::CXXReinterpretCastExprClass:
case Expr::CXXConstCastExprClass:
return EmitCastLValue(cast<CastExpr>(E));
- case Expr::CXXZeroInitValueExprClass:
- return EmitNullInitializationLValue(cast<CXXZeroInitValueExpr>(E));
}
}
Added: cfe/trunk/test/CodeGenCXX/default-arguments.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/default-arguments.cpp?rev=88735&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/default-arguments.cpp (added)
+++ cfe/trunk/test/CodeGenCXX/default-arguments.cpp Fri Nov 13 19:51:50 2009
@@ -0,0 +1,13 @@
+// RUN: clang-cc -emit-llvm %s -o - -triple=x86_64-apple-darwin10
+
+// PR5484
+namespace PR5484 {
+struct A { };
+extern A a;
+
+void f(const A & = a);
+
+void g() {
+ f();
+}
+}
More information about the cfe-commits
mailing list