[SCM] GiNaC -- a C++ library for symbolic computations branch, master, updated. release_1-4-0-709-gf271f67d
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GiNaC -- a C++ library for symbolic computations". The branch, master has been updated via f271f67d2fc798079326e450bc0e53eb80fb2e96 (commit) from a569b4748e266ce318602e7b6a9c1f19a8c75bdf (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- 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. ----------------------------------------------------------------------- Summary of changes: ginac/exprseq.h | 3 +++ ginac/lst.h | 3 +++ 2 files changed, 6 insertions(+) hooks/post-receive -- GiNaC -- a C++ library for symbolic computations
Richard, 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." Best regards, Alexey
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.
Dear Richard, On 2/8/21 3:20 PM, Richard B. Kreckel wrote:
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>.
That program is ill formed, since there's the explicit specialization of A<double>::name in the a.cpp translation unit, but not in others. The error message is not very clear, however according to the standard no diagnostics is required in this case. And in lst.cpp we've got an explicit specialization of lst::reg_info. So the declaration you've added is correct and required. However both the commit message and the comments in {lst,exprseq}.h are misleading. Best regards, Alexey
On 22.02.21 19:32, Alexey Sheplyakov wrote:
That program is ill formed, since there's the explicit specialization of A<double>::name in the a.cpp translation unit, but not in others.
Well, if you like, it sounds best to discuss this on StackOverflow.
The error message is not very clear, however according to the standard no diagnostics is required in this case.
And in lst.cpp we've got an explicit specialization of lst::reg_info. So the declaration you've added is correct and required.
However both the commit message and the comments in {lst,exprseq}.h are misleading.
Right, you said so. Let's just fix the comment, then. -richy. -- Richard B. Kreckel <https://in.terlu.de/~kreckel/>
participants (3)
-
Alexey Sheplyakov
-
Richard B. Kreckel
-
Richard B. Kreckel