Hello Jan, On 14.02.22 20:31, Jan Rheinländer wrote:
that was MSVC from Visual Studio 2019. But the same happens with 19.30.30706 from VS 2022. Also, past experience shows that MSVC is very strict (you might say pedantic) about the standard. So I have little hope that the problem will go away with a new version of MSVC.
Can you produce a stripped-down example and file a bug report against MSVC at Microsoft, please?
The help page for error 2766 <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-errors-2/compiler-error-c2766?view=msvc-170> says "Duplicate explicit specializations are not allowed". Though looking at the thread <https://www.ginac.de/pipermail/ginac-devel/2021-February/002539.html> you cited it would seem that the code in the header should be viewed as a declaration, not a 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 cannot add anything to the standard section you cite. According to my reading and understanding, MSVC is confused if it thinks this is a definition.
On the other hand, looking at structure.h, it does assign a value to reg_info in the header file. So maybe the solution I suggested (move GINAC_IMPLEMENT_REGISTERED_CLASS_OPT_T to the header) is not that bad after all?
Can't we just #ifdef out the declaration for MSVC? -richy.