Drop a superfluous NULL write

Storing NULL here on failure is brittle and was only necessary when the
typechecker was leaking type variables in expressions.  Now that we're
better about this, it's best to preserve the damaged AST.
This commit is contained in:
Robert Widmann
2019-09-03 09:43:47 -07:00
parent 157613afbc
commit 2d836f45be
3 changed files with 2 additions and 18 deletions

View File

@@ -6021,13 +6021,8 @@ ParamDecl::getDefaultValueStringRepresentation(
if (!existing.empty())
return existing;
if (!getDefaultValue()) {
// TypeChecker::checkDefaultArguments() nulls out the default value
// if it fails to type check it. This only seems to happen with an
// invalid/incomplete parameter list that contains a parameter with an
// unresolved default value.
return "<<empty>>";
}
assert(getDefaultValue()
&& "Normal default argument with no default expression?!");
return extractInlinableText(getASTContext().SourceMgr, getDefaultValue(),
scratch);
}