/// \brief Create the initialization entity for a parameter.
static InitializedEntity InitializeParameter(ASTContext &Context,
ParmVarDecl *Parm) {
- return InitializeParameter(Context, Parm,
- Parm->getType().getUnqualifiedType());
+ return InitializeParameter(Context, Parm, Parm->getType());
}
/// \brief Create the initialization entity for a parameter, but use
InitializedEntity Entity;
Entity.Kind = EK_Parameter;
- Entity.Type = Context.getVariableArrayDecayedType(Type);
+ Entity.Type =
+ Context.getVariableArrayDecayedType(Type.getUnqualifiedType());
Entity.Parent = 0;
Entity.Parameter
= (static_cast<uintptr_t>(Consumed) | reinterpret_cast<uintptr_t>(Parm));
--- /dev/null
+// RUN: %clang_cc1 -ast-dump %s | FileCheck %s
+
+void foo1(void*);
+void foo2(void* const);
+
+
+void bar() {
+ // CHECK: (FunctionDecl {{.*}} <line:{{.*}}, line:{{.*}}> bar 'void ()'
+
+ foo1(0);
+ // CHECK: (ImplicitCastExpr {{.*}} <col:{{.*}}> 'void *' <NullToPointer>
+
+ foo2(0);
+ // CHECK: (ImplicitCastExpr {{.*}} <col:{{.*}}> 'void *' <NullToPointer>
+}