d: Return promoted types in d_type_promotes_to when linkage is not D
This enables warnings to be shown when a bad type is passed to va_arg
inside an extern(C) or extern(C++) function.
gcc/d/ChangeLog:
PR d/97002
* d-codegen.cc (d_build_call): Set input_location on CALL_EXPR.
* d-lang.cc: Include function.h.
(d_type_promotes_to): Do default conversions for C and C++ functions.
* intrinsics.cc (expand_intrinsic_vaarg): Use build1_loc to build
VA_ARG_EXPR.
gcc/testsuite/ChangeLog:
PR d/97002
* gdc.dg/pr97002.d: New test.