[cfe-commits] r78502 - in /cfe/trunk: lib/Sema/SemaExprCXX.cpp test/CodeGenCXX/array-pointer-decay.cpp
Anders Carlsson
andersca at mac.com
Sat Aug 8 14:04:35 PDT 2009
Author: andersca
Date: Sat Aug 8 16:04:35 2009
New Revision: 78502
URL: http://llvm.org/viewvc/llvm-project?rev=78502&view=rev
Log:
Use CastExpr::CK_ArrayToPointerDecay and fix an assert.
Added:
cfe/trunk/test/CodeGenCXX/array-pointer-decay.cpp
Modified:
cfe/trunk/lib/Sema/SemaExprCXX.cpp
Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=78502&r1=78501&r2=78502&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Sat Aug 8 16:04:35 2009
@@ -927,7 +927,7 @@
case ICK_Array_To_Pointer:
FromType = Context.getArrayDecayedType(FromType);
- ImpCastExprToType(From, FromType);
+ ImpCastExprToType(From, FromType, CastExpr::CK_ArrayToPointerDecay);
break;
case ICK_Function_To_Pointer:
Added: cfe/trunk/test/CodeGenCXX/array-pointer-decay.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/array-pointer-decay.cpp?rev=78502&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/array-pointer-decay.cpp (added)
+++ cfe/trunk/test/CodeGenCXX/array-pointer-decay.cpp Sat Aug 8 16:04:35 2009
@@ -0,0 +1,7 @@
+// RUN: clang-cc %s -emit-llvm -o -
+
+void f(const char*);
+
+void g() {
+ f("hello");
+}
More information about the cfe-commits
mailing list