c++: result location and explicit inst [PR108496]
In r13-4469 we started to build the RESULT_DECL in grokdeclarator, while we
still know the location of the return type. But in this testcase, we hit
that code again when parsing the explicit instantiation, and clobber the
DECL_RESULT that was previously used in parsing the function. So, only set
DECL_RESULT if it isn't already set.
PR c++/108496
gcc/cp/ChangeLog:
* decl.cc (grokdeclarator): Check whether DECL_RESULT is already
set.
gcc/testsuite/ChangeLog:
* g++.dg/template/explicit-instantiation5.C: New test.