Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

braced-init-list in ranged for loop is not supported (C++11)?

Andrey_K_
Beginner
495 Views

Hi, according C++11 specification (in my case I refer to draft n3376) the following 'for' construction is valid:

#include <iostream>
int main(void) {
    for (auto x : { 0, 1, 2 }){
        std::cout << x;
    }
}

But trying to compile it with intel c++ compiler gives me error:

main.cpp(3): error : assertion failed at: "shared/cfe/edgcpfe/il.c", line 15066

I have installed the following compiler: Intel® C++ Composer XE 2013 SP1 Update 2 Integration for Microsoft* Visual Studio* 2013, Version 14.0.1290.12

0 Kudos
1 Solution
Hubert_H_Intel
Employee
495 Views

Andrey,

With the Intel® Composer XE 2015 Beta we have full C++11 support now. Would you like to try it out?

http://software.intel.com/en-us/articles/intel-software-development-tools-2015-beta

On Linux we have support for initializer lists with g++ 4.4. So - as Franz mentions - the Intel Composer XE 2013 SP1 compiles on openSUSE 13.2 which is g++ 4.8 based.

By the way: Which is your serial number of the Intel C++ Composer XE v14.0? You can answer via "Send Author A Message". Thanks!

Regards, Hubert.

View solution in original post

0 Kudos
5 Replies
bernaske
New Contributor I
495 Views

Hi Andrey,

 

i have Your sample compile under openSUSE 13.2 Linux no probems on compile and execute see output:

linux-cuda60:/system_programming/projects # icpc -m64 -std=c++11 testicc.c                                                                     
linux-cuda60:/system_programming/projects # icpc -m64 -std=c++11 testicc.c -o test1                                                            
linux-cuda60:/system_programming/projects # ./test1                                                                                            
012linux-cuda60:/system_programming/projects #   

icpc (ICC) 14.0.2 20140120                                                                                                                     
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.         this is my compiler version

regards

Franz

 

                                                                    

                                                                                             

0 Kudos
Hubert_H_Intel
Employee
496 Views

Andrey,

With the Intel® Composer XE 2015 Beta we have full C++11 support now. Would you like to try it out?

http://software.intel.com/en-us/articles/intel-software-development-tools-2015-beta

On Linux we have support for initializer lists with g++ 4.4. So - as Franz mentions - the Intel Composer XE 2013 SP1 compiles on openSUSE 13.2 which is g++ 4.8 based.

By the way: Which is your serial number of the Intel C++ Composer XE v14.0? You can answer via "Send Author A Message". Thanks!

Regards, Hubert.

0 Kudos
Andrey_K_
Beginner
495 Views

If I understand the right way, the Intel Composer XE 2013 SP1 for windows should be based on MSVC, but MSVC12 also support initializer_list, and can compile the example above

0 Kudos
Hubert_H_Intel
Employee
495 Views

Andrey,

Yes, the MSVC12 compiles the code. The Intel compiler is based on MSVC since we do not have our own standard libraries and a linker.

Does this answer your question?

Hubert.

0 Kudos
Andrey_K_
Beginner
495 Views

Yes, with the Intel® Composer XE 2015 Beta it works fine, thank you.

0 Kudos
Reply