Quantcast
Channel: Intel® Software - Intel® C++ Compiler
Viewing all 2797 articles
Browse latest View live

Aggregate initialization bug with nested struct

$
0
0

Hi, I think I came across a compiler bug.

The following example throws on intel c++ compiler 2017.4.210

This is using c++14, Windows 7, Visual studio 2017. 

#include <vector>
#include <stdexcept>

struct A
{
    int a;
    int b;
    int c;
    int d;
};

struct B
{
    A a;
    std::vector<int> b;
};


int main() {

    B b{};

    if (b.a.a || b.a.b || b.a.c || b.a.d) throw std::runtime_error("Compiler bug?");
}

b is initialized using empty braces, so it should performe aggregate initialization. b.a should be zero-initialized, but it is left uninitialized.

AttachmentSize
Downloadapplication/rarIntelCompiler.rar3.06 KB

Compiler 17.0 Update 4 for Intel 64 Visual Studio 2012 environment

$
0
0

Hi guys, 

I have a code written in Visual Studio 2012 and I need to compile it with Intel Parallel Studio XE 2017. Does "Intel Parallel Studio XE 2017" support Visual studio 2012?

Or any other version can support my visual studio 2012 program?

Regards

Aggregate initialization bug with nested struct

$
0
0

Hi, I think I came across a compiler bug.

The following example throws on intel c++ compiler 2017.4.210

This is using c++14, Windows 7, Visual studio 2017. 

#include <vector>
#include <stdexcept>

struct A
{
    int a;
    int b;
    int c;
    int d;
};

struct B
{
    A a;
    std::vector<int> b;
};


int main() {

    B b{};

    if (b.a.a || b.a.b || b.a.c || b.a.d) throw std::runtime_error("Compiler bug?");
}

b is initialized using empty braces, so it should performe aggregate initialization. b.a should be zero-initialized, but it is left uninitialized.

AttachmentSize
Downloadapplication/rarIntelCompiler.rar3.06 KB

Compiler 17.0 Update 4 for Intel 64 Visual Studio 2012 environment

$
0
0

Hi guys, 

I have a code written in Visual Studio 2012 and I need to compile it with Intel Parallel Studio XE 2017. Does "Intel Parallel Studio XE 2017" support Visual studio 2012?

Or any other version can support my visual studio 2012 program?

Regards

Aggregate initialization bug with nested struct

$
0
0

Hi, I think I came across a compiler bug.

The following example throws on intel c++ compiler 2017.4.210

This is using c++14, Windows 7, Visual studio 2017. 

#include <vector>
#include <stdexcept>

struct A
{
    int a;
    int b;
    int c;
    int d;
};

struct B
{
    A a;
    std::vector<int> b;
};


int main() {

    B b{};

    if (b.a.a || b.a.b || b.a.c || b.a.d) throw std::runtime_error("Compiler bug?");
}

b is initialized using empty braces, so it should performe aggregate initialization. b.a should be zero-initialized, but it is left uninitialized.

AttachmentSize
Downloadapplication/rarIntelCompiler.rar3.06 KB

Buggy behavior in constexpr memeber variable

$
0
0

Hi,

 

I found that intel c++ compiler behaves suspiciously for constexpr member variable of a template class. With 

$ icpc -v
icpc version 19.0.5.281 (gcc version 8.3.0 compatibility)

The following code print nothing.

#include <iostream>
template<typename T>
struct Derived
{
	constexpr static char test_[] = "test";
};
/* These lines are useless in C++17
template<typename T>
constexpr char Derived<T>::test_[];
*/
int main()
{
	std::cout << Derived<double>::test_ << std::endl; //print nothing
	return 0;
}

I just used '-std=c++17' option. GCC version 8 compiles the code and print "test" as expected. I strongly suspect that GCC's behavior is the standard and ICC is buggy.

In addition, ICC version 2019.3.199 does not compile the code and print error "incomplete type is not allowed".

 

Best,

 

 

 

Compiler 17.0 Update 4 for Intel 64 Visual Studio 2012 environment

$
0
0

Hi guys, 

I have a code written in Visual Studio 2012 and I need to compile it with Intel Parallel Studio XE 2017. Does "Intel Parallel Studio XE 2017" support Visual studio 2012?

Or any other version can support my visual studio 2012 program?

Regards

VS 2019 Debugger + ICC 2020 : "step over" works like "step into"

$
0
0

Hello,

i use VS 2019 with Intel c++ 2020.

If i compile a program with VC only the debugger works like expected. I can go through the code line by line using "step over".

If I compile the same code with intel c++ "step over" works like "step into".

How do I get the normal behavior of "step over"?

 


Aggregate initialization bug with nested struct

$
0
0

Hi, I think I came across a compiler bug.

The following example throws on intel c++ compiler 2017.4.210

This is using c++14, Windows 7, Visual studio 2017. 

#include <vector>
#include <stdexcept>

struct A
{
    int a;
    int b;
    int c;
    int d;
};

struct B
{
    A a;
    std::vector<int> b;
};


int main() {

    B b{};

    if (b.a.a || b.a.b || b.a.c || b.a.d) throw std::runtime_error("Compiler bug?");
}

b is initialized using empty braces, so it should performe aggregate initialization. b.a should be zero-initialized, but it is left uninitialized.

AttachmentSize
Downloadapplication/rarIntelCompiler.rar3.06 KB

Compiler 17.0 Update 4 for Intel 64 Visual Studio 2012 environment

$
0
0

Hi guys, 

I have a code written in Visual Studio 2012 and I need to compile it with Intel Parallel Studio XE 2017. Does "Intel Parallel Studio XE 2017" support Visual studio 2012?

Or any other version can support my visual studio 2012 program?

Regards

Aggregate initialization bug with nested struct

$
0
0

Hi, I think I came across a compiler bug.

The following example throws on intel c++ compiler 2017.4.210

This is using c++14, Windows 7, Visual studio 2017. 

#include <vector>
#include <stdexcept>

struct A
{
    int a;
    int b;
    int c;
    int d;
};

struct B
{
    A a;
    std::vector<int> b;
};


int main() {

    B b{};

    if (b.a.a || b.a.b || b.a.c || b.a.d) throw std::runtime_error("Compiler bug?");
}

b is initialized using empty braces, so it should performe aggregate initialization. b.a should be zero-initialized, but it is left uninitialized.

AttachmentSize
Downloadapplication/rarIntelCompiler.rar3.06 KB

Compiler 17.0 Update 4 for Intel 64 Visual Studio 2012 environment

$
0
0

Hi guys, 

I have a code written in Visual Studio 2012 and I need to compile it with Intel Parallel Studio XE 2017. Does "Intel Parallel Studio XE 2017" support Visual studio 2012?

Or any other version can support my visual studio 2012 program?

Regards

Aggregate initialization bug with nested struct

$
0
0

Hi, I think I came across a compiler bug.

The following example throws on intel c++ compiler 2017.4.210

This is using c++14, Windows 7, Visual studio 2017. 

#include <vector>
#include <stdexcept>

struct A
{
    int a;
    int b;
    int c;
    int d;
};

struct B
{
    A a;
    std::vector<int> b;
};


int main() {

    B b{};

    if (b.a.a || b.a.b || b.a.c || b.a.d) throw std::runtime_error("Compiler bug?");
}

b is initialized using empty braces, so it should performe aggregate initialization. b.a should be zero-initialized, but it is left uninitialized.

AttachmentSize
Downloadapplication/rarIntelCompiler.rar3.06 KB

Compiler 17.0 Update 4 for Intel 64 Visual Studio 2012 environment

$
0
0

Hi guys, 

I have a code written in Visual Studio 2012 and I need to compile it with Intel Parallel Studio XE 2017. Does "Intel Parallel Studio XE 2017" support Visual studio 2012?

Or any other version can support my visual studio 2012 program?

Regards

Aggregate initialization bug with nested struct

$
0
0

Hi, I think I came across a compiler bug.

The following example throws on intel c++ compiler 2017.4.210

This is using c++14, Windows 7, Visual studio 2017. 

#include <vector>
#include <stdexcept>

struct A
{
    int a;
    int b;
    int c;
    int d;
};

struct B
{
    A a;
    std::vector<int> b;
};


int main() {

    B b{};

    if (b.a.a || b.a.b || b.a.c || b.a.d) throw std::runtime_error("Compiler bug?");
}

b is initialized using empty braces, so it should performe aggregate initialization. b.a should be zero-initialized, but it is left uninitialized.

AttachmentSize
Downloadapplication/rarIntelCompiler.rar3.06 KB

Buggy behavior in constexpr memeber variable

$
0
0

Hi,

 

I found that intel c++ compiler behaves suspiciously for constexpr member variable of a template class. With 

$ icpc -v
icpc version 19.0.5.281 (gcc version 8.3.0 compatibility)

The following code print nothing.

#include <iostream>
template<typename T>
struct Derived
{
	constexpr static char test_[] = "test";
};
/* These lines are useless in C++17
template<typename T>
constexpr char Derived<T>::test_[];
*/
int main()
{
	std::cout << Derived<double>::test_ << std::endl; //print nothing
	return 0;
}

I just used '-std=c++17' option. GCC version 8 compiles the code and print "test" as expected. I strongly suspect that GCC's behavior is the standard and ICC is buggy.

In addition, ICC version 2019.3.199 does not compile the code and print error "incomplete type is not allowed".

 

Best,

 

 

 

Compiler 17.0 Update 4 for Intel 64 Visual Studio 2012 environment

$
0
0

Hi guys, 

I have a code written in Visual Studio 2012 and I need to compile it with Intel Parallel Studio XE 2017. Does "Intel Parallel Studio XE 2017" support Visual studio 2012?

Or any other version can support my visual studio 2012 program?

Regards

VS 2019 Debugger + ICC 2020 : "step over" works like "step into"

$
0
0

Hello,

i use VS 2019 with Intel c++ 2020.

If i compile a program with VC only the debugger works like expected. I can go through the code line by line using "step over".

If I compile the same code with intel c++ "step over" works like "step into".

How do I get the normal behavior of "step over"?

 

Aggregate initialization bug with nested struct

$
0
0

Hi, I think I came across a compiler bug.

The following example throws on intel c++ compiler 2017.4.210

This is using c++14, Windows 7, Visual studio 2017. 

#include <vector>
#include <stdexcept>

struct A
{
    int a;
    int b;
    int c;
    int d;
};

struct B
{
    A a;
    std::vector<int> b;
};


int main() {

    B b{};

    if (b.a.a || b.a.b || b.a.c || b.a.d) throw std::runtime_error("Compiler bug?");
}

b is initialized using empty braces, so it should performe aggregate initialization. b.a should be zero-initialized, but it is left uninitialized.

AttachmentSize
Downloadapplication/rarIntelCompiler.rar3.06 KB

Buggy behavior in constexpr memeber variable

$
0
0

Hi,

 

I found that intel c++ compiler behaves suspiciously for constexpr member variable of a template class. With 

$ icpc -v
icpc version 19.0.5.281 (gcc version 8.3.0 compatibility)

The following code print nothing.

#include <iostream>
template<typename T>
struct Derived
{
	constexpr static char test_[] = "test";
};
/* These lines are useless in C++17
template<typename T>
constexpr char Derived<T>::test_[];
*/
int main()
{
	std::cout << Derived<double>::test_ << std::endl; //print nothing
	return 0;
}

I just used '-std=c++17' option. GCC version 8 compiles the code and print "test" as expected. I strongly suspect that GCC's behavior is the standard and ICC is buggy.

In addition, ICC version 2019.3.199 does not compile the code and print error "incomplete type is not allowed".

 

Best,

 

 

 

Viewing all 2797 articles
Browse latest View live