Fix a crasher in Template Diffing.

Value depenedent expressions for default arguments cannot be evaluated.
Instead, use the desugared template type to get an argument expression that
can be used.  This is needed for both integer and declaration arguements.

Also, move this common code into a separate function.

Patch by Olivier Goffart!


git-svn-id: http://llvm.org/svn/llvm-project/cfe/trunk@178609 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a crasher in Template Diffing.

When support was added for declaration arguments, the case of variadic
declaration arguments was not supported.  This patch fixes that problem by
not crashing when certain ValueDecl's are null.

Patch by Olivier Goffart!


git-svn-id: http://llvm.org/svn/llvm-project/cfe/trunk@178610 91177308-0d34-0410-b5e6-96231b3b80d8
Do not assume the template argument is an integer only because the
expressions are integer.  It can also be ValueDecl expressions

Use the type information from the TemplateParameterList instead

Patch by Olivier Goffart!


git-svn-id: http://llvm.org/svn/llvm-project/cfe/trunk@178611 91177308-0d34-0410-b5e6-96231b3b80d8