Unresolved symbols after upgrading to C++ compiler 14.0

Unresolved symbols after upgrading to C++ compiler 14.0

imagem de Jean-michel Rouet

Dear All,

 

Since I updated to Intel Composer 14.0 (ie 13.0 SP1, and even SP1 update 1) I do have some code which do not link any more.
Although the code work ok with every other compiler I know of.

Here is an exerpt to reproduce my issue. The following code does nothing meaningful here, it is purely illustrative, so don't try to remove useless templates.

    struct Base
    {
        static const int mCount = 0;
        virtual int  GetCount() const {return 0;}
    };
 
    class A
    {
        template<typename T> 
        class Items 
        { 
        public: 
            template <int ID> struct Prop {};
            template <>  struct Prop<0> : public Base
            { 
                static const int mCount = Base::mCount+1;
                int parA;
 
                Prop() : parA(0) {} 
                int GetCount() const { return this->mCount;} 
            };
        };
 
 
    public:
        struct ParsStruct : public Items<int>::Prop<0> {};
 
        ParsStruct* mPars;
        A() : mPars(new ParsStruct()) {}
    };
 
 
    int main(int argc, const char *argv[])
    {
        A a;
        a.mPars->parA = 1;
        return 0;
    }

 

 

At link time, I get unresolved symbols on A::Items<int>::Prop<0>::Getcount(void) const like:
error LNK2001: unresolved external symbol "public: virtual int __thiscall A::Items<int>::Prop<0>::GetCount(void)const " (?GetCount@?$Prop@$0A@@?$Items@H@A@@UBEHXZ)

Although the metod is clearly defined. the specialized class Prop<0> is also dfined and Items<int>::Prop<0> explicitely used.
Can some guru explain me what has changed between Composer XE 13.0 and 14.0, such that this code links correctly in the old version and not in the new one ?

Any hint ? Is it a compiler bug or a feature ?

Very best regards,

Jean-Michel

 

5 posts / 0 new
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.
imagem de Jean-michel Rouet

Sorry for the badly formated initial message. The carriage returns were not interpreted as expected...

 

Meanwhile, I found a workaround to my issue. It seems that explicit specialization of the Prop<int ID> class within a class (i.e. not at the namespace scope) it not allowed by the C++ standard. When I reorganise the code to change this (using partial specialization), it compiles and links correctly.
 

However, if explicit specialization was realy the issue, it should have been a compilation issue rather than a link issue, right ?

 

imagem de Judith Ward (Intel)

 

This should compile and link successfully on our Windows platform since Microsoft allows this non standard specialization.

You are right this broke in 14.0.

I have submitted a bug in our bug tracking system (DPD200250257) for this defect. Thank you for reporting it.

Judy

imagem de Jean-michel Rouet

Hi Judith,

 

Where can I follow the status of this bug ? Is your bug tracking system public ?

Best regards,
Jean-Michel.

 

Quote:

Judith Ward (Intel) wrote:

 

This should compile and link successfully on our Windows platform since Microsoft allows this non standard specialization.

You are right this broke in 14.0.

I have submitted a bug in our bug tracking system (DPD200250257) for this defect. Thank you for reporting it.

Judy

imagem de Tim Prince

If you submit bugs yourself using your support account, this should improve your chance of seeing progress reports.  You could submit the bug now and quote the DPD number.

Faça login para deixar um comentário.