Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Yaniv_H_
Beginner
63 Views

icpc fails to alert on an obvious compilation error in a call to std::copy

The following simple code shows a strange behavior compiled by icpc:

#include <algorithm>
#include <complex>
#include <vector>

struct Float {
    float _f;
};

struct Float2 {
    float _f1;
    float _f2;
};

// using objType = float;               // Uncommenting this line will cause compilation to fail in line 22 (call to std::copy () in A::copyVect ())
// using objType = Float;               // Same for this line
// using objType = Float2;              // And for thils line too
using objType = std::complex<float>;    // For this line compilation succeeds though it should fail as well

class A {
public:
    void copyVect (std::vector<objType> &vectSrc) const {
        std::copy (vectSrc.begin (), vectSrc.end (), _vect.begin ());
    }

public:
    std::vector<objType> _vect;
};

int main()
{
    return 0;
}

Compilation was done using the command:

icpc-4.8 -std=c++11 stdcopy.cpp -o stdcopy

 

0 Kudos
1 Reply
MalReddy_Y_Intel
Employee
63 Views

Hi,

This issue is fixed in the latest icc 17.0.1 compiler. Please try with that.

#icpc -v
icpc version 17.0.1 (gcc version 4.8.5 compatibility)
 

Thanks,

Reddy

 

Reply