Fix bugs with default parameter values for pointer-typed function parameters.

In particular "void foo(int * ptr = NULL)" and the like work now.

Issue #197.
This commit is contained in:
Matt Pharr
2012-03-28 11:51:56 -07:00
parent b3c5043dcc
commit 540fc6c2f3
4 changed files with 24 additions and 22 deletions

View File

@@ -547,7 +547,7 @@ Module::AddFunctionDeclaration(Symbol *funSym, bool isInline) {
for (int i = 0; i < nArgs; ++i) {
const Type *argType = functionType->GetParameterType(i);
const std::string &argName = functionType->GetParameterName(i);
ConstExpr *defaultValue = functionType->GetParameterDefault(i);
Expr *defaultValue = functionType->GetParameterDefault(i);
const SourcePos &argPos = functionType->GetParameterSourcePos(i);
// If the function is exported, make sure that the parameter