On 08.02.21 12:04, Alexey Sheplyakov wrote:
On 2/3/21 6:50 PM, Richard B. Kreckel via GiNaC-devel wrote:
commit f271f67d2fc798079326e450bc0e53eb80fb2e96 Author: Richard Kreckel <kreckel@ginac.de> Date: Wed Feb 3 14:40:49 2021 +0100
Avoid "instantiation of variable 'reg_info' required..." warning. With -Wundefined-var-template (on by default), CLang++ warns that no definition for the static 'reg_info' member variable is available.
The patch confuses me a bit.
Firstly, the compiler has complained about missing instantiation, and you've provided (an explicit) specialization instead. Yet the compiler seems to be happy.
Secondly this
/** Definition of container::reg_info for exprseq. */ template<> registered_class_info exprseq::reg_info;
is a declaration, not definition. According to 14.7.3.13 "An explicit specialization of a static data member of a template is a definition if the declaration includes an initializer; otherwise, it's a declaration."
I was following this advice here <https://stackoverflow.com/questions/56463004/fixing-warning-wundefined-var-template>. -richy.